Scripts: Quote path variables

This commit is contained in:
Unrud
2022-06-05 14:06:25 +02:00
committed by Matthias Mailänder
parent bb2ee37cc0
commit ea02b90636
3 changed files with 8 additions and 8 deletions

View File

@@ -1,15 +1,15 @@
#!/bin/sh
ENGINEDIR=$(dirname "$0")
if command -v mono >/dev/null 2>&1 && [ "$(grep -c .NETCoreApp,Version= ${ENGINEDIR}/bin/OpenRA.dll)" = "0" ]; then
if command -v mono >/dev/null 2>&1 && [ "$(grep -c .NETCoreApp,Version= "${ENGINEDIR}/bin/OpenRA.dll")" = "0" ]; then
RUNTIME_LAUNCHER="mono --debug"
else
RUNTIME_LAUNCHER="dotnet"
fi
if command -v python3 >/dev/null 2>&1; then
LAUNCHPATH=$(python3 -c "import os; print(os.path.realpath('$0'))")
LAUNCHPATH=$(python3 -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$0")
else
LAUNCHPATH=$(python -c "import os; print(os.path.realpath('$0'))")
LAUNCHPATH=$(python -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$0")
fi
# Prompt for a mod to launch if one is not already specified
@@ -32,7 +32,7 @@ then
fi
# Launch the engine with the appropriate arguments
${RUNTIME_LAUNCHER} ${ENGINEDIR}/bin/OpenRA.dll Engine.EngineDir=".." Engine.LaunchPath="${LAUNCHPATH}" ${MODARG} "$@"
${RUNTIME_LAUNCHER} "${ENGINEDIR}/bin/OpenRA.dll" Engine.EngineDir=".." Engine.LaunchPath="${LAUNCHPATH}" ${MODARG} "$@"
# Show a crash dialog if something went wrong
if [ $? != 0 ] && [ $? != 1 ]; then