-
Notifications
You must be signed in to change notification settings - Fork 0
/
bowlerstudio
67 lines (55 loc) · 1.99 KB
/
bowlerstudio
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
EXE_NAME=bowlerstudio
SCRIPT_EXPECTED=$HOME/bin/$EXE_NAME
DESKTOP_FILE=$HOME/bin/bowlerstudio.desktop
SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#https://cdn.azul.com/zulu/bin/zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_x64.zip
JVERELEASE=zulu8.78.0.19-ca-fx-jdk8.0.412-macosx_x64
if [[ $(uname -m) == 'arm64' ]]; then
echo "M1 Mac detected https://cdn.azul.com/zulu/bin/zulu8.62.0.19-ca-fx-jdk8.0.332-macosx_aarch64.tar.gz"
JVERELEASE=zulu8.78.0.19-ca-fx-jdk8.0.412-macosx_aarch64
fi
JVMDIR=$HOME/bin/java8/
JAR=BowlerStudio.jar
AUTOUPDATE=$HOME/bin/java8/LatestFromGithubLaunch.jar
unzipifiy(){
testget $1 $2
echo "Unzipping $1 to $2"
tar -xzf $2/$1.tar.gz -C $2
mv $2/$1/* $2/
rmdir $2/$1/
}
testget () {
if [ -f $JVERELEASE.tar.gz ]; then
echo "$JVERELEASE.tar.gz exist"
else
echo Downloading from https://www.azul.com/downloads/zulu/zulufx/
echo downloading https://cdn.azul.com/zulu/bin/$JVERELEASE.tar.gz
curl -L https://cdn.azul.com/zulu/bin/$JVERELEASE.tar.gz -o $2$1.tar.gz
fi
}
if (! test -e $JVMDIR/$JVERELEASE.tar.gz) then
rm -rf $JVMDIR
mkdir -p $JVMDIR
unzipifiy $JVERELEASE $JVMDIR
fi
if (! test -e $AUTOUPDATE) then
curl -L https://github.com/CommonWealthRobotics/LatestFromGithubLaunch/releases/latest/download/LatestFromGithubLaunch.jar -o $AUTOUPDATE
fi
# Copy the script to $HOME/bin if it is not already there
if ! [ "$SCRIPT" = "$HOME/bin" ]; then
echo "Script source copied to $HOME/bin from " $SCRIPT
cp $SCRIPT/$EXE_NAME $SCRIPT_EXPECTED
chmod +x $SCRIPT_EXPECTED
fi
set -e
if grep -q '$HOME/bin/' $HOME/.bashrc; then
echo "Skipping adding ~/bin/ to $HOME/.bashrc, command already exists";
else
echo 'export PATH=$PATH:$HOME/bin/' >> $HOME/.bashrc;
echo 'echo Path: $PATH' >> $HOME/.bashrc;
echo 'Added $PATH=$PATH:$HOME/bin/ to ~/.bashrc';
source $HOME/.bashrc
fi
source $HOME/.bashrc
$JVMDIR/bin/java -jar $AUTOUPDATE CommonWealthRobotics BowlerStudio BowlerStudio.jar $JVMDIR/bin/java -Dprism.forceGPU=true -jar