b/c...py: warn about exit code during only rendering
This commit is contained in:
parent
e810309303
commit
16f5272df1
@ -87,10 +87,12 @@ def substitute_vars(replacements: Dict[str, Union[bool, str]], text: str,
|
||||
print()
|
||||
return text
|
||||
|
||||
def run_command(*command: list[str]) -> None:
|
||||
def run_command(*command: list[str], stage: str) -> None:
|
||||
print("[>]", command_line_join(command), flush=True)
|
||||
if subprocess.run(command).returncode != EXIT_SUCCESS:
|
||||
if stage == "rendering":
|
||||
print("An error occured during rendering!")
|
||||
|
||||
raise SystemExit(EXIT_FAILURE)
|
||||
|
||||
def compile_substituted_file(input_file: str, executable_file: str) -> None:
|
||||
@ -102,9 +104,10 @@ def compile_substituted_file(input_file: str, executable_file: str) -> None:
|
||||
input_file,
|
||||
PATHS["fwrite_le"],
|
||||
"-o", executable_file,
|
||||
"-I" + PATHS["include_directory"]
|
||||
"-I" + PATHS["include_directory"],
|
||||
stage="compilation"
|
||||
)
|
||||
run_command(executable_file)
|
||||
run_command(executable_file, stage="rendering")
|
||||
|
||||
def main_workflow(input_file: str, executable_file: str, \
|
||||
substitute_contents: Dict[str, str]) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user