From b60032f92f552c04585d2780761e426b026a707f Mon Sep 17 00:00:00 2001 From: David Galiffi Date: Mon, 11 Nov 2024 17:27:08 -0500 Subject: [PATCH] Execute arguments via eval Porting https://github.com/ROCm/omnitrace/pull/410. As eval builtin interprets its arguments in the same way as shell would do, which would need some escape work, otherwise, it won't work if the input arguments contains e.g. a JSON string: omnitrace-python -- ./test.py --json='{"foo": "bar"}' --- cmake/Templates/console-script.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Templates/console-script.in b/cmake/Templates/console-script.in index 039de3e4..76a5fafb 100755 --- a/cmake/Templates/console-script.in +++ b/cmake/Templates/console-script.in @@ -14,4 +14,4 @@ run-script() eval $@ } -run-script ${PYTHON_EXECUTABLE} -m @SCRIPT_SUBMODULE@ $@ +run-script ${PYTHON_EXECUTABLE} -m @SCRIPT_SUBMODULE@ "$(printf ' %q' "$@")"