Skip to content

Commit

Permalink
Pass the full command string if running in a real shell
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Jan 20, 2017
1 parent d1fb47d commit d576fb6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gitman/shell.py
Expand Up @@ -27,7 +27,7 @@ def call(name, *args, _show=True, _shell=False, _ignore=False):
program = show(name, *args, stdout=_show)

command = subprocess.run(
[name, *args], universal_newlines=True,
name if _shell else [name, *args], universal_newlines=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
shell=_shell
)
Expand Down Expand Up @@ -57,7 +57,7 @@ def call(name, *args, _show=True, _shell=False, _ignore=False):
def mkdir(path):
if not os.path.exists(path):
if os.name == 'nt':
call('mkdir', path, _shell=True)
call('mkdir', path)
else:
call('mkdir', '-p', path)

Expand All @@ -83,9 +83,9 @@ def ln(source, target):
def rm(path):
if os.name == 'nt':
if os.path.isfile(path):
call('del', '/Q', '/F', path, _shell=True)
call('del', '/Q', '/F', path)
elif os.path.isdir(path):
call('rmdir', '/Q', '/S', path, _shell=True)
call('rmdir', '/Q', '/S', path)
else:
call('rm', '-rf', path)

Expand Down

0 comments on commit d576fb6

Please sign in to comment.