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:
authorAnton Hvornum <anton@hvornum.se>2021-04-02 20:36:06 +0200
committerAnton Hvornum <anton@hvornum.se>2021-04-02 20:36:06 +0200
commitf61c61305e95c564f22120bebbb861eddd7dee45 (patch)
tree99ffd29bfb8e30e6332676742927500013d99b95 /archinstall/lib/general.py
parent35855700f711381755118a5e04a46ddcc1ba47fe (diff)
parent4221473e6782c659dbd1f2681b0d2e05a3aa54b6 (diff)
Merge branch 'exec-args' of https://github.com/kpcyrd/archinstall into torxed-v2.2.0
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