ba0efacd3f
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"}'
18 satır
449 B
Bash
Çalıştırılabilir Dosya
18 satır
449 B
Bash
Çalıştırılabilir Dosya
#!/usr/bin/env bash
|
|
|
|
export PYTHONPATH=$(cd $(dirname ${BASH_SOURCE[0]})/../@CMAKE_INSTALL_PYTHONDIR@ && pwd):${PYTHONPATH}
|
|
|
|
: ${PYTHON_EXECUTABLE:=@PYTHON_EXECUTABLE@}
|
|
|
|
if [ ! -f ${PYTHON_EXECUTABLE} ]; then PYTHON_EXECUTABLE=$(basename ${PYTHON_EXECUTABLE}); fi
|
|
|
|
set -e
|
|
|
|
run-script()
|
|
{
|
|
echo -e "\n##### ${PROJECT_NAME} :: executing '${@}'... #####\n"
|
|
eval $@
|
|
}
|
|
|
|
run-script ${PYTHON_EXECUTABLE} -m @SCRIPT_SUBMODULE@ "$(printf ' %q' "$@")"
|