Passed shell argument to check_call instead of calling cmd.exe directly

This commit is contained in:
Hirschfeld
2017-07-13 22:15:19 +10:00
parent f25ec3c3f0
commit 874ed0c450

View File

@@ -181,10 +181,9 @@ class Bower(BaseCommand):
env = os.environ.copy() env = os.environ.copy()
env['PATH'] = npm_path env['PATH'] = npm_path
args = ['bower', 'install', '--allow-root', '--config.interactive=false'] args = ['bower', 'install', '--allow-root', '--config.interactive=false']
if os.name == 'nt': shell = True if os.name == 'nt' else False
args = ['cmd', '/C'] + args
try: try:
check_call(args, cwd=here, env=env) check_call(args, cwd=here, env=env, shell=shell)
except OSError as e: except OSError as e:
print("Failed to run bower: %s" % e, file=sys.stderr) print("Failed to run bower: %s" % e, file=sys.stderr)
print("You can install js dependencies with `npm install`", file=sys.stderr) print("You can install js dependencies with `npm install`", file=sys.stderr)
@@ -240,10 +239,9 @@ class CSS(BaseCommand):
'--source-map-rootpath=../', '--source-map-rootpath=../',
style_less, style_css, style_less, style_css,
] ]
if os.name == 'nt': shell = True if os.name == 'nt' else False
args = ['cmd', '/C'] + args
try: try:
check_call(args, cwd=here, env=env) check_call(args, cwd=here, env=env, shell=shell)
except OSError as e: except OSError as e:
print("Failed to run lessc: %s" % e, file=sys.stderr) print("Failed to run lessc: %s" % e, file=sys.stderr)
print("You can install js dependencies with `npm install`", file=sys.stderr) print("You can install js dependencies with `npm install`", file=sys.stderr)