Use subproctools.print_command.

This commit is contained in:
voussoir 2021-01-14 02:31:43 -08:00
parent a8314990f2
commit 1359ab040e

View file

@ -10,6 +10,7 @@ import time
from voussoirkit import betterhelp from voussoirkit import betterhelp
from voussoirkit import bytestring from voussoirkit import bytestring
from voussoirkit import pathclass from voussoirkit import pathclass
from voussoirkit import subproctools
from voussoirkit import vlogging from voussoirkit import vlogging
from voussoirkit import winglob from voussoirkit import winglob
from voussoirkit import winwhich from voussoirkit import winwhich
@ -279,13 +280,17 @@ def run_script(script, dry=False):
''' '''
status = 0 status = 0
if dry:
for command in script:
print(command)
return status
for command in script: for command in script:
print(command) if isinstance(command, str):
print(command)
elif isinstance(command, list):
subproctools.print_command(command)
else:
print(command)
if dry:
continue
if isinstance(command, str): if isinstance(command, str):
status = os.system(command) status = os.system(command)
elif isinstance(command, list): elif isinstance(command, list):