Skip to content

Commit

Permalink
ease quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
Korijn committed Dec 14, 2023
1 parent 95ade84 commit 05d96b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion keycmd/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ def run_shell(env=None):
def run_cmd(cmd, env=None):
"""Run a one-off command in a shell."""
shell_name, shell_path = get_shell()
opt = "-c"
if shell_name == "cmd":
opt = "/C"
else:
opt = "-c"
cmd = [" ".join(cmd)]
full_command = [shell_path, opt, *cmd]
vlog(f"running command: {pformat(full_command)}")
exec(full_command, env)

0 comments on commit 05d96b6

Please sign in to comment.