-
|
Hi. Today faced a problem with directory changing. I didn't found any docs examples or github issues, so sorry if I mistaken something. tasks:
create:
cmds:
- |
cd 'Level X\nupkg\'
pwd
rm *.nupkg
cd '..'
dotnet packBut I dont like it, because I'm basically smash all commands together into one. Is there a way to do something like this: tasks:
create:
cmds:
- cd 'Level X\nupkg\'
- pwd
- rm *.nupkg
- cd '..'
- dotnet packor tasks:
create:
cmds:
- dir: 'Level X\nupkg\'
- pwd
- rm *.nupkg
- dir: '..'
- dotnet packThank you for your attention |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Each Task command is executed in isolation (i.e. its own shell) and so a Unfortunately, there is no # Does not work in 3.18
tasks:
create:
cmds:
- cmd: pwd
dir: 'Level X\nupkg\'
...The tasks:
remove-and-create:
cmds:
- task: remove
- task: create
remove:
dir: 'Level X\nupkg\'
cmds:
- pwd
- rm *.nupkg
create:
dir: 'Level X'
cmds:
- dotnet pack |
Beta Was this translation helpful? Give feedback.
Each Task command is executed in isolation (i.e. its own shell) and so a
cdin one command will not affect the directory of any subsequent commands. This isolation is by design and cannot be changed.Unfortunately, there is no
dirkeyword at acmdlevel either, so you also can't currently do anything like your second suggestion. However, I think this would be a valid feature request and would probably look something like this:The
dirkeyword is available at a task level though, so you could do something like this today: