From 252d549e3fcaa43930f0c8772109c81f61abd543 Mon Sep 17 00:00:00 2001 From: Pete Davison Date: Thu, 16 May 2024 01:50:18 +0100 Subject: [PATCH] feat: task executable variable (#1624) --- internal/compiler/compiler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/compiler/compiler.go b/internal/compiler/compiler.go index 649f0ff7..85bf4809 100644 --- a/internal/compiler/compiler.go +++ b/internal/compiler/compiler.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "os" "path/filepath" "strings" "sync" @@ -196,6 +197,7 @@ func (c *Compiler) ResetCache() { func (c *Compiler) getSpecialVars(t *ast.Task) (map[string]string, error) { return map[string]string{ "TASK": t.Task, + "TASK_EXE": filepath.ToSlash(os.Args[0]), "ROOT_TASKFILE": filepathext.SmartJoin(c.Dir, c.Entrypoint), "ROOT_DIR": c.Dir, "TASKFILE": t.Location.Taskfile,