mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-13 01:20:24 +02:00
use shlex.join to quote run_command_str for better error messages
This commit is contained in:
@ -9,6 +9,7 @@ import re
|
|||||||
import importlib
|
import importlib
|
||||||
import textwrap
|
import textwrap
|
||||||
import signal
|
import signal
|
||||||
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
import jc
|
import jc
|
||||||
@ -547,7 +548,7 @@ def main():
|
|||||||
# if magic syntax used, try to run the command and error if it's not found, etc.
|
# if magic syntax used, try to run the command and error if it's not found, etc.
|
||||||
magic_stdout, magic_stderr, magic_exit_code = None, None, 0
|
magic_stdout, magic_stderr, magic_exit_code = None, None, 0
|
||||||
if run_command:
|
if run_command:
|
||||||
run_command_str = ' '.join(run_command)
|
run_command_str = shlex.join(run_command)
|
||||||
|
|
||||||
if valid_command:
|
if valid_command:
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user