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:
Valentin Maerten
2026-05-17 17:59:28 +02:00
parent b27a6653f6
commit d96d6fe703
7 changed files with 179 additions and 9 deletions

View File

@@ -73,7 +73,7 @@ func NewNode(
return node, err
}
func isRemoteEntrypoint(entrypoint string) bool {
func IsRemoteEntrypoint(entrypoint string) bool {
scheme, _ := getScheme(entrypoint)
switch scheme {
case "git", "http", "https":