-
-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xr_3da: add sample run shell script by a1batross
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |