diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2022-06-17 20:37:07 +0200 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2022-06-17 20:37:07 +0200 |
commit | 1622e9c9435d263c3c275718947b1030ad9b6b48 (patch) | |
tree | 2e82f9e7e3b8b5403aed7b0f50e098b17e4ffa54 /svg-flatten | |
parent | 48f78dd391fd38bbf5c888839349fe48b2f3383b (diff) | |
download | gerbolyze-1622e9c9435d263c3c275718947b1030ad9b6b48.tar.gz gerbolyze-1622e9c9435d263c3c275718947b1030ad9b6b48.tar.bz2 gerbolyze-1622e9c9435d263c3c275718947b1030ad9b6b48.zip |
svg-flatten-wasi: fix env var override
Diffstat (limited to 'svg-flatten')
-rw-r--r-- | svg-flatten/svg_flatten_wasi/__init__.py | 8 |
1 files changed, 6 insertions, 2 deletions
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 |