When commands are executed via the base.command task, they generally inherit the environment from the se process. Since se is a Python script, some things work differently compared to shell scripts. One such thing is that $PWD is not updated when base.command is run with the cwd argument, i.e. when the current working directory is changed. This is because Python does not behave like bash or other shells and subprocess.Popen is not updating $PWD! Or seen the other way around, $PWD is a shell environment variable and subprocess does not fiddle with it (see, for example, here).
However, the base.command task it is often used to run shell scripts and therefore it is expected that $PWD is updated as it would in a shell. Thus, updating $PWD should be implemented in base.command.
When commands are executed via the
base.command
task, they generally inherit the environment from these
process. Sincese
is a Python script, some things work differently compared to shell scripts. One such thing is that$PWD
is not updated whenbase.command
is run with thecwd
argument, i.e. when the current working directory is changed. This is because Python does not behave like bash or other shells andsubprocess.Popen
is not updating$PWD
! Or seen the other way around,$PWD
is a shell environment variable andsubprocess
does not fiddle with it (see, for example, here).However, the
base.command
task it is often used to run shell scripts and therefore it is expected that$PWD
is updated as it would in a shell. Thus, updating$PWD
should be implemented inbase.command
.