Skip to content

Commit

Permalink
xr_3da: add sample run shell script by a1batross
Browse files Browse the repository at this point in the history
  • Loading branch information
q4a committed Oct 6, 2018
1 parent 7088efa commit 8e95702
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/xr_3da/xr_3da.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

SCRIPT_NAME=$(basename "$0")
GAMEROOT=$(dirname -- "$(readlink -f -- "$0")")
if [ -z "$GAMEEXE" ]; then
GAMEEXE=${SCRIPT_NAME%.*} # strip extension(not required, but do anyway)
fi

#determine platform
UNAME=$(uname)
if [ "$UNAME" = "Darwin" ]; then
# prepend our lib path to DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=${GAMEROOT}:$DYLD_LIBRARY_PATH
else
# prepend our lib path to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${GAMEROOT}:$LD_LIBRARY_PATH
fi

# and launch the game
if ! cd "$GAMEROOT"; then
echo "Failed cd to $GAMEROOT"
exit
fi

STATUS=42
while [ $STATUS -eq 42 ]; do
${DEBUGGER} "${GAMEROOT}"/"${GAMEEXE}" "$@"
STATUS=$?
done
exit $STATUS

0 comments on commit 8e95702

Please sign in to comment.