Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-03-23 14:18:03 +0100
committerAnton Hvornum <anton.feeds@gmail.com>2021-03-23 14:18:03 +0100
commitb672efdf6b5951e53fa3548cc06cd1c319f82217 (patch)
tree33170d4a51f18c10f3c191403cdce9a23da2a995 /archinstall
parentaceb0f3e98ea1009474f24cf02fdcf3e5923bcc7 (diff)
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.
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/general.py6
1 files changed, 5 insertions, 1 deletions
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.