-
Notifications
You must be signed in to change notification settings - Fork 0
/
katapult.sh
64 lines (57 loc) · 1.89 KB
/
katapult.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
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
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if (! test -e ~/bin) then
mkdir ~/bin
fi
if ! [ "$SCRIPT" = "$HOME/bin" ]; then
echo "Script source copied to ~/bin from " $SCRIPT
cp $SCRIPT/katapult.sh ~/bin/katapult.sh
chmod +x ~/bin/katapult.sh
fi
#https://cdn.azul.com/zulu/bin/zulu8.42.0.23-ca-fx-jre8.0.232-linux_x64.tar.gz
JVERELEASE=zulu8.44.0.13-ca-fx-jdk8.0.242-linux_x64
#JVERELEASE=zulu8.42.0.23-ca-fx-jre8.0.232-linux_x64
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
wget 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 ~/bin/katapult.desktop) then
echo "[Desktop Entry]
Version=1.0
Type=Application
Name=Katapult SmallKat Launcher
Comment=
Exec=$HOME/bin/katapult.sh
Icon=$HOME/bowler-workspace/gitcache/github.com/OperationSmallKat/Katapult/icon.png
Path=
Terminal=true
StartupNotify=false" > ~/bin/katapult.desktop
chmod +x ~/bin/katapult.desktop
gio set ~/bin/katapult.desktop "metadata::trusted" yes
ln -s ~/bin/katapult.desktop ~/Desktop/katapult.desktop
gio set ~/Desktop/katapult.desktop "metadata::trusted" yes
fi
value=`cat ~/bin/BowlerStudioInstall/currentversion.txt`
echo "$value"
$JVMDIR/bin/java -jar ~/bin/BowlerStudioInstall/$value/BowlerStudio.jar -g https://github.com/OperationSmallKat/Katapult.git launch.groovy