aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2022-06-17 20:37:07 +0200
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2022-06-17 20:37:07 +0200
commit1622e9c9435d263c3c275718947b1030ad9b6b48 (patch)
tree2e82f9e7e3b8b5403aed7b0f50e098b17e4ffa54
parent48f78dd391fd38bbf5c888839349fe48b2f3383b (diff)
downloadgerbolyze-1622e9c9435d263c3c275718947b1030ad9b6b48.tar.gz
gerbolyze-1622e9c9435d263c3c275718947b1030ad9b6b48.tar.bz2
gerbolyze-1622e9c9435d263c3c275718947b1030ad9b6b48.zip
svg-flatten-wasi: fix env var override
-rw-r--r--svg-flatten/svg_flatten_wasi/__init__.py8
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