Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/general.py
diff options
context:
space:
mode:
authorkpcyrd <git@rxv.cc>2021-04-02 20:03:38 +0200
committerkpcyrd <git@rxv.cc>2021-04-02 20:03:38 +0200
commit4221473e6782c659dbd1f2681b0d2e05a3aa54b6 (patch)
tree1d17670ad927f546bef16df540efacc6f874e1d1 /archinstall/lib/general.py
parent0488c93a507fcb9e687b083ed8f11622d43ca9c2 (diff)
Support passing commands as lists
Diffstat (limited to 'archinstall/lib/general.py')
-rw-r--r--archinstall/lib/general.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index f2a714e7..ae2501c2 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -86,11 +86,19 @@ class sys_command():#Thread):
if kwargs['emulate']:
self.log(f"Starting command '{cmd}' in emulation mode.", level=LOG_LEVELS.Debug)
- self.raw_cmd = cmd
- try:
- self.cmd = shlex.split(cmd)
- except Exception as e:
- raise ValueError(f'Incorrect string to split: {cmd}\n{e}')
+ if type(cmd) is list:
+ # if we get a list of arguments
+ self.raw_cmd = shlex.join(cmd)
+ self.cmd = cmd
+ else:
+ # else consider it a single shell string
+ # this should only be used if really necessary
+ self.raw_cmd = cmd
+ try:
+ self.cmd = shlex.split(cmd)
+ except Exception as e:
+ raise ValueError(f'Incorrect string to split: {cmd}\n{e}')
+
self.args = args
self.kwargs = kwargs