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 @@ -70,7 +70,10 @@ func (e *Executor) getRootNode() (taskfile.Node, error) {
7070 if err != nil {
7171 return nil , err
7272 }
73- e .Dir = node .Dir ()
73+ if len (e .Dir ) == 0 {
74+ // Only set the executor dir if it was not already set (i.e. --dir or --global).
75+ e .Dir = node .Dir ()
76+ }
7477 e .Entrypoint = node .Location ()
7578 return node , err
7679}
@@ -219,7 +222,6 @@ func (e *Executor) setupCompiler() error {
219222 return err
220223 }
221224 }
222-
223225 e .Compiler = & Compiler {
224226 Dir : e .Dir ,
225227 Entrypoint : e .Entrypoint ,
You can’t perform that action at this time.
0 commit comments