1
0
mirror of https://github.com/go-task/task.git synced 2024-12-12 10:45:49 +02:00

feat: task executable variable (#1624)

This commit is contained in:
Pete Davison 2024-05-16 01:50:18 +01:00 committed by GitHub
parent 182d43e8d8
commit 252d549e3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,