bytebeat_compiler.py: make use of shlex.join
When printing a command that is going to be ran, use `shlex.join(...)` instead of `" ".join(...)`
This commit is contained in:
parent
b8323731cb
commit
8c7d7ac8f9
@ -6,7 +6,7 @@ if __name__ == "__main__":
|
|||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from os import environ, makedirs, name as os_name
|
from os import environ, makedirs, name as os_name
|
||||||
from os.path import exists, join as path_join
|
from os.path import exists, join as path_join
|
||||||
from shlex import split as command_line_split
|
from shlex import join as command_line_join, split as command_line_split
|
||||||
from shutil import which
|
from shutil import which
|
||||||
from sys import stdin, stdout, exit
|
from sys import stdin, stdout, exit
|
||||||
from typing import Dict, Union
|
from typing import Dict, Union
|
||||||
@ -91,7 +91,7 @@ def substitute_vars(replacements: Dict[str, Union[bool, str]], text: str,
|
|||||||
return text
|
return text
|
||||||
|
|
||||||
def run_command(*command: list[str]) -> None:
|
def run_command(*command: list[str]) -> None:
|
||||||
print(" ".join(command), flush=True)
|
print(command_line_join(command), flush=True)
|
||||||
if subprocess.run(command).returncode != EXIT_SUCCESS:
|
if subprocess.run(command).returncode != EXIT_SUCCESS:
|
||||||
exit(EXIT_FAILURE)
|
exit(EXIT_FAILURE)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user