2018-10-01 23:44:37 +02:00
|
|
|
# SubCreator Vanilla Build Script
|
|
|
|
#
|
|
|
|
#!/usr/bin/env bash
|
2019-06-17 05:13:48 +02:00
|
|
|
if [[ -z "$version" ]]
|
2018-10-01 23:44:37 +02:00
|
|
|
then
|
|
|
|
echo ERROR: No Build Version Supplied
|
|
|
|
rm -Rf "$0"
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-12-18 20:15:02 +01:00
|
|
|
if [[ -z "$java" ]]
|
|
|
|
then
|
|
|
|
export java="java"
|
|
|
|
fi
|
2018-10-01 23:44:37 +02:00
|
|
|
function __DL() {
|
2019-06-17 05:13:48 +02:00
|
|
|
if [[ -x "$(command -v wget)" ]]; then
|
2018-10-01 23:44:37 +02:00
|
|
|
wget -O "$1" "$2"; return $?
|
|
|
|
else
|
|
|
|
curl -o "$1" "$2"; return $?
|
|
|
|
fi
|
|
|
|
}
|
2019-06-17 05:13:48 +02:00
|
|
|
if [[ -z "$cache" ]] || [[ ! -f "$cache/Vanilla-$version.jar" ]]; then
|
|
|
|
if [[ -d "VanillaCord" ]]; then
|
2018-10-01 23:44:37 +02:00
|
|
|
rm -Rf VanillaCord
|
|
|
|
fi
|
|
|
|
mkdir VanillaCord
|
|
|
|
echo Downloading the VanillaCord Launcher...
|
2019-12-12 03:01:28 +01:00
|
|
|
__DL VanillaCord/VanillaCord.jar https://dev.me1312.net/jenkins/job/VanillaCord/job/master/lastSuccessfulBuild/artifact/artifacts/VanillaCord.jar; __RETURN=$?
|
2019-06-17 05:13:48 +02:00
|
|
|
if [[ $__RETURN -eq 0 ]]; then
|
2018-10-01 23:44:37 +02:00
|
|
|
cd VanillaCord
|
|
|
|
echo Launching VanillaCord
|
2019-12-18 20:15:02 +01:00
|
|
|
"$java" -jar VanillaCord.jar "$version"; __RETURN=$?;
|
2019-06-17 05:13:48 +02:00
|
|
|
if [[ $__RETURN -eq 0 ]]; then
|
2018-10-01 23:44:37 +02:00
|
|
|
echo Copying Finished Jar...
|
|
|
|
cd ../
|
2019-06-17 05:13:48 +02:00
|
|
|
if [[ -f "Vanilla.jar" ]]; then
|
|
|
|
if [[ -f "Vanilla.old.jar.x" ]]; then
|
|
|
|
rm -Rf Vanilla.old.jar.x
|
|
|
|
fi
|
|
|
|
mv Vanilla.jar Vanilla.old.jar.x
|
|
|
|
fi
|
|
|
|
if [[ ! -z "$cache" ]] && [[ -d "$cache" ]]; then
|
2019-01-14 01:52:44 +01:00
|
|
|
cp "VanillaCord/out/$version-bungee.jar" "$cache/Vanilla-$version.jar"
|
2018-10-01 23:44:37 +02:00
|
|
|
fi
|
2019-01-14 01:52:44 +01:00
|
|
|
cp "VanillaCord/out/$version-bungee.jar" Vanilla.jar
|
2018-10-01 23:44:37 +02:00
|
|
|
echo Cleaning Up...
|
|
|
|
rm -Rf VanillaCord
|
|
|
|
rm -Rf "$0"
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo ERROR: VanillaCord exited with an error. Please try again
|
|
|
|
rm -Rf VanillaCord
|
|
|
|
rm -Rf "$0"
|
|
|
|
exit 4
|
|
|
|
fi
|
|
|
|
else
|
2020-06-12 07:45:49 +02:00
|
|
|
echo ERROR: Failed Downloading VanillaCord. Is ME1312.net down?
|
2018-10-01 23:44:37 +02:00
|
|
|
rm -Rf VanillaCord
|
|
|
|
rm -Rf "$0"
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo Copying Cached Jar...
|
2019-01-14 01:52:44 +01:00
|
|
|
cp "$cache/Vanilla-$version.jar" Vanilla.jar
|
2018-10-01 23:44:37 +02:00
|
|
|
echo Cleaning Up...
|
|
|
|
rm -Rf "$0"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
exit 2
|