Skip to content

Commit e94da1b

Browse files
fmoessbauerjan-kiszka
authored andcommitted
do not change current working directory on setup_dir
The SetupDir command takes care of creating the kas build directory and also changes the current working directory (despite not mentioned in the docstring). This is is problematic as there is no way to later tell which directory kas was initially started in. When setting up the initial config (happens before running the macros), we resolve the kas files relative to the working directory - which is expected to be the one kas was invoked in. However, when creating a second set of config files after the first has been created and SetupDir was executed, this fails as we try to resolve relative to KAS_WORK_DIR. In current kas this behavior is side-effect free, as it only operates on a single config. However, with upcoming plugins like diff not globally changing the cwd becomes mandatory. Signed-off-by: Felix Moessbauer <[email protected]> Signed-off-by: Jan Kiszka <[email protected]>
1 parent 0d800bd commit e94da1b

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

kas/libcmds.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ def __str__(self):
378378
return 'setup_dir'
379379

380380
def execute(self, ctx):
381-
os.chdir(ctx.kas_work_dir)
382381
if not os.path.exists(ctx.build_dir):
383382
os.mkdir(ctx.build_dir)
384383

0 commit comments

Comments
 (0)