MCPcopy
hub / github.com/go-task/task / CompiledTaskForTaskList

Method CompiledTaskForTaskList

variables.go:43–90  ·  view source on GitHub ↗
(call *Call)

Source from the content-addressed store, hash-verified

41}
42
43func (e *Executor) CompiledTaskForTaskList(call *Call) (*ast.Task, error) {
44 origTask, err := e.GetTask(call)
45 if err != nil {
46 return nil, err
47 }
48
49 vars, err := e.Compiler.FastGetVariables(origTask, call)
50 if err != nil {
51 return nil, err
52 }
53
54 cache := &templater.Cache{Vars: vars}
55
56 gitignore := e.shouldTaskUseGitignore(origTask)
57
58 return &ast.Task{
59 Task: origTask.Task,
60 Label: templater.Replace(origTask.Label, cache),
61 Desc: templater.Replace(origTask.Desc, cache),
62 Prompt: templater.Replace(origTask.Prompt, cache),
63 Summary: templater.Replace(origTask.Summary, cache),
64 Aliases: origTask.Aliases,
65 Sources: origTask.Sources,
66 Generates: origTask.Generates,
67 Dir: origTask.Dir,
68 Set: origTask.Set,
69 Shopt: origTask.Shopt,
70 Vars: vars,
71 Env: nil,
72 Dotenv: origTask.Dotenv,
73 Silent: deepcopy.Scalar(origTask.Silent),
74 UseGitignore: &gitignore,
75 Interactive: origTask.Interactive,
76 Internal: origTask.Internal,
77 Method: origTask.Method,
78 Prefix: origTask.Prefix,
79 IgnoreError: origTask.IgnoreError,
80 Run: origTask.Run,
81 IncludeVars: origTask.IncludeVars,
82 IncludedTaskfileVars: origTask.IncludedTaskfileVars,
83 Platforms: origTask.Platforms,
84 Location: origTask.Location,
85 Requires: origTask.Requires,
86 Watch: origTask.Watch,
87 Namespace: origTask.Namespace,
88 Failfast: origTask.Failfast,
89 }, nil
90}
91
92func (e *Executor) compiledTask(call *Call, evaluateShVars bool) (*ast.Task, error) {
93 origTask, err := e.GetTask(call)

Callers 2

GetTaskListMethod · 0.95

Calls 5

GetTaskMethod · 0.95
ReplaceFunction · 0.92
ScalarFunction · 0.92
FastGetVariablesMethod · 0.80

Tested by 1