fix icon
[divverent/netradiant.git] / setup / data / osx / NetRadiant.app / Contents / MacOS / netradiant.sh
1 #!/bin/sh
2
3 MY_DIRECTORY="${0%/*}" # cut off the script name
4 MY_DIRECTORY="${MY_DIRECTORY%/*}" # cut off MacOS
5 MY_DIRECTORY="${MY_DIRECTORY%/*}" # cut off Contents
6
7 export DYLD_LIBRARY_PATH="$MY_DIRECTORY/Contents/MacOS/install"
8 export PANGO_RC_FILE="$MY_DIRECTORY/Contents/MacOS/pangorc"
9 export GDK_PIXBUF_MODULE_FILE="$MY_DIRECTORY/Contents/MacOS/gdk-pixbuf.loaders"
10
11 cd "$MY_DIRECTORY/Contents/MacOS/install"
12
13 # autodetect nexuiz installs
14 NEX_DIRECTORY="/${MY_DIRECTORY%/*}"
15 while :; do
16         if [ -z "$NEX_DIRECTORY" ]; then
17                 break
18         fi
19         if [ -f "$NEX_DIRECTORY/data/common-spog.pk3" ]; then
20                 if [ -d "$NEX_DIRECTORY/Nexuiz.app" ]; then
21                         break
22                 fi
23         fi
24         NEX_DIRECTORY=${NEX_DIRECTORY%/*}
25 done
26 case "$NEX_DIRECTORY" in
27         //*)
28                 NEX_DIRECTORY=${NEX_DIRECTORY#/}
29                 set -- -global-gamefile nexuiz.game -nexuiz.game-EnginePath "$NEX_DIRECTORY/"
30                 # -global-gamePrompt false?
31                 ;;
32         *)
33                 set --
34                 ;;
35 esac
36
37 if [ -x /usr/bin/open-x11 ]; then
38         /usr/bin/open-x11 ./radiant.ppc "$@" &
39 else
40         ./radiant.ppc "$@" &
41 fi