forked from pharo-project/pharo-launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpharo-launcher.sh
executable file
·37 lines (32 loc) · 1.17 KB
/
pharo-launcher.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
# some magic to find out the real location of this script dealing with symlinks
DIR=`readlink "$0"` || DIR="$0";
# disable parameter expansion to forward all arguments unprocessed to the VM
set -f
# DETECT SYSTEM PROPERTIES ======================================================
TMP_OS=`uname | tr "[:upper:]" "[:lower:]"`
if [[ "{$TMP_OS}" = *darwin* ]]; then
OS="mac";
elif [[ "{$TMP_OS}" = *linux* ]]; then
OS="linux";
elif [[ "{$TMP_OS}" = *win* ]]; then
OS="win";
elif [[ "{$TMP_OS}" = *mingw* ]]; then
OS="win";
elif [[ "{$TMP_OS}" = *msys* ]]; then
OS="win";
else
echo "Unsupported OS";
exit 1;
fi
if [ -z "$ARCHITECTURE" ] ; then
ARCHITECTURE=32;
fi
# RUN THE VM and pass along all arguments as is ================================
if [ "$OS" = "linux" ]; then
ROOT=$(dirname "$DIR");
"$ROOT"/pharo-vm/pharo --headless "$ROOT"/shared/PharoLauncher.image --no-default-preferences clap launcher "$@"
elif [ "$OS" = "mac" ]; then
ROOT=$(dirname "$(dirname "$DIR")");
"$ROOT"/MacOs/Pharo --headless "$ROOT"/Resources/PharoLauncher.image --no-default-preferences clap launcher "$@"
fi