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:
parent
182d43e8d8
commit
252d549e3f
@ -5,6 +5,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@ -196,6 +197,7 @@ func (c *Compiler) ResetCache() {
|
|||||||
func (c *Compiler) getSpecialVars(t *ast.Task) (map[string]string, error) {
|
func (c *Compiler) getSpecialVars(t *ast.Task) (map[string]string, error) {
|
||||||
return map[string]string{
|
return map[string]string{
|
||||||
"TASK": t.Task,
|
"TASK": t.Task,
|
||||||
|
"TASK_EXE": filepath.ToSlash(os.Args[0]),
|
||||||
"ROOT_TASKFILE": filepathext.SmartJoin(c.Dir, c.Entrypoint),
|
"ROOT_TASKFILE": filepathext.SmartJoin(c.Dir, c.Entrypoint),
|
||||||
"ROOT_DIR": c.Dir,
|
"ROOT_DIR": c.Dir,
|
||||||
"TASKFILE": t.Location.Taskfile,
|
"TASKFILE": t.Location.Taskfile,
|
||||||
|
Loading…
Reference in New Issue
Block a user