From b672efdf6b5951e53fa3548cc06cd1c319f82217 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 23 Mar 2021 14:18:03 +0100 Subject: Enabling archinstall.sys_command() to get a working directory when executing. The sys_command() is working pretty well for this very specific need, but this is an attempt to making it a bit more generic. A more general overhaul of the command should be done at some point. --- archinstall/lib/general.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'archinstall') diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 28fc0934..d79bbaa2 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -106,7 +106,11 @@ class sys_command():#Thread): user_catalogue = os.path.expanduser('~') self.cwd = f"{user_catalogue}/.cache/archinstall/workers/{kwargs['worker_id']}/" - self.exec_dir = f'{self.cwd}/{os.path.basename(self.cmd[0])}_workingdir' + + if (workdir := kwargs.get('workdir', None)): + self.exec_dir = workdir + else: + self.exec_dir = f'{self.cwd}/{os.path.basename(self.cmd[0])}_workingdir' if not self.cmd[0][0] == '/': # "which" doesn't work as it's a builtin to bash. -- cgit v1.2.3-54-g00ecf