File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -275,6 +275,12 @@ func (o *flagsOption) ApplyToExecutor(e *task.Executor) {
275275 if err == nil {
276276 dir = home
277277 }
278+ } else {
279+ if len (dir ) > 0 {
280+ // Use the cli provided directory.
281+ cwd , _ := os .Getwd ()
282+ dir = filepath .Join (cwd , dir )
283+ }
278284 }
279285
280286 e .Options (
Original file line number Diff line number Diff line change @@ -67,7 +67,10 @@ func (e *Executor) getRootNode() (taskfile.Node, error) {
6767 if err != nil {
6868 return nil , err
6969 }
70- e .Dir = node .Dir ()
70+ if len (e .Dir ) == 0 {
71+ // Only set the executor dir if it was not already set (i.e. --dir or --global).
72+ e .Dir = node .Dir ()
73+ }
7174 e .Entrypoint = node .Location ()
7275 return node , err
7376}
@@ -216,7 +219,6 @@ func (e *Executor) setupCompiler() error {
216219 return err
217220 }
218221 }
219-
220222 e .Compiler = & Compiler {
221223 Dir : e .Dir ,
222224 Entrypoint : e .Entrypoint ,
You can’t perform that action at this time.
0 commit comments