mirror of
https://github.com/go-task/task.git
synced 2026-06-24 13:15:51 +00:00
fix(remote): define special variables behavior
Issue #2267 — Define semantics of file-path special variables when the Taskfile is loaded from a remote source (HTTP/HTTPS/Git): - TASKFILE / ROOT_TASKFILE: raw URL (fixes the broken `https:/...` caused by filepath.Join collapsing the double slash) - TASKFILE_DIR / ROOT_DIR: empty string — a DIR variable cannot point to a URL - TASK_DIR: resolved against USER_WORKING_DIR Export taskfile.IsRemoteEntrypoint so the compiler can dispatch on the nature of the entrypoint without relying on `c.Dir == ""` (a side effect of the remote path).
This commit is contained in:
@@ -188,7 +188,7 @@ func (node *GitNode) ReadContext(ctx context.Context) ([]byte, error) {
|
||||
|
||||
func (node *GitNode) ResolveEntrypoint(entrypoint string) (string, error) {
|
||||
// If the file is remote, we don't need to resolve the path
|
||||
if isRemoteEntrypoint(entrypoint) {
|
||||
if IsRemoteEntrypoint(entrypoint) {
|
||||
return entrypoint, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user