Skip to content

Commit

Permalink
use ~/sauerbraten-code if SAUER_DIR not set
Browse files Browse the repository at this point in the history
  • Loading branch information
sauerbraten committed Nov 27, 2020
1 parent c514900 commit 7c4ef65
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

PATCH=patch --strip=0 --remove-empty-files --ignore-whitespace

ifndef SAUER_DIR
ifneq (,$(wildcard ~/sauerbraten-code))
SAUER_DIR=~/sauerbraten-code
endif
endif

build: update-src apply-patches
cd src && make client

Expand Down
19 changes: 13 additions & 6 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#!/bin/sh
# SAUER_DATA should refer to the directory in which Sauerbraten data files are placed.
#SAUER_DATA=~/sauerbraten
#SAUER_DATA=/usr/local/sauerbraten
SAUER_DATA=.
# SAUER_DIR should refer to the directory in which Sauerbraten data files are placed.
#SAUER_DIR=~/sauerbraten
if [ -z ${SAUER_DIR} ]
then
if [ -x ~/sauerbraten-code ]
then
SAUER_DIR=~/sauerbraten-code
else
echo "SAUER_DIR not set and ~/sauerbraten-code does not exist"
exit 1
fi
fi

# SAUER_BIN should refer to the directory in which Sauerbraten executable files are placed.
SAUER_BIN=${SAUER_DATA}/bin_unix
SAUER_BIN=./bin_unix

# SAUER_OPTIONS contains any command line options you would like to start Sauerbraten with.
#SAUER_OPTIONS="-f"
Expand Down Expand Up @@ -52,7 +60,6 @@ fi

if [ -x ${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}client ]
then
cd ${SAUER_DATA}
exec ${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}client ${SAUER_OPTIONS} "$@"
else
echo "Your platform does not have a pre-compiled Sauerbraten client."
Expand Down

0 comments on commit 7c4ef65

Please sign in to comment.