Skip to content

Commit

Permalink
Execute arguments via eval
Browse files Browse the repository at this point in the history
Porting ROCm/omnitrace#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"}'
  • Loading branch information
dgaliffiAMD authored Nov 11, 2024
1 parent 3d10efc commit b60032f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/Templates/console-script.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ run-script()
eval $@
}

run-script ${PYTHON_EXECUTABLE} -m @SCRIPT_SUBMODULE@ $@
run-script ${PYTHON_EXECUTABLE} -m @SCRIPT_SUBMODULE@ "$(printf ' %q' "$@")"

0 comments on commit b60032f

Please sign in to comment.