From 1622e9c9435d263c3c275718947b1030ad9b6b48 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 17 Jun 2022 20:37:07 +0200 Subject: svg-flatten-wasi: fix env var override --- svg-flatten/svg_flatten_wasi/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'svg-flatten') diff --git a/svg-flatten/svg_flatten_wasi/__init__.py b/svg-flatten/svg_flatten_wasi/__init__.py index be57cba..c52118b 100644 --- a/svg-flatten/svg_flatten_wasi/__init__.py +++ b/svg-flatten/svg_flatten_wasi/__init__.py @@ -104,7 +104,7 @@ def run_usvg(input_file, output_file, **usvg_args): # if USVG envvar is set, try that first. if 'USVG' in os.environ: - exec_candidates = [os.environ['USVG'], *exec_candidates] + candidates = [os.environ['USVG'], *candidates] for candidate in candidates: try: @@ -144,5 +144,9 @@ def run_svg_flatten(input_file, output_file, other_args, no_usvg, **usvg_args): input_file = f.name cmdline = ['svg-flatten', '--force-svg', '--no-usvg', *other_args, input_file, output_file] - sys.exit(_run_wasm_app("svg-flatten.wasm", cmdline)) + exit_code = _run_wasm_app("svg-flatten.wasm", cmdline) + if exit_code: + exc = click.ClickException(f'Process returned exit code {exit_code}') + exc.exit_code = exit_code + raise exc -- cgit