mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 10:15:52 +01:00
68 lines
2.0 KiB
Bash
68 lines
2.0 KiB
Bash
# SubCreator Vanilla Build Script
|
|
#
|
|
#!/usr/bin/env bash
|
|
if [[ -z "$version" ]]
|
|
then
|
|
echo ERROR: No Build Version Supplied
|
|
rm -Rf "$0"
|
|
exit 1
|
|
fi
|
|
if [[ -z "$java" ]]
|
|
then
|
|
export java="java"
|
|
fi
|
|
function __DL() {
|
|
if [[ -x "$(command -v wget)" ]]; then
|
|
wget -O "$1" "$2"; return $?
|
|
else
|
|
curl -Lo "$1" "$2"; return $?
|
|
fi
|
|
}
|
|
if [[ -z "$cache" ]] || [[ ! -f "$cache/Vanilla-$version.jar" ]]; then
|
|
if [[ -d "VanillaCord" ]]; then
|
|
rm -Rf VanillaCord
|
|
fi
|
|
mkdir VanillaCord
|
|
echo Downloading the VanillaCord Launcher...
|
|
__DL VanillaCord/VanillaCord.jar https://dev.me1312.net/jenkins/job/VanillaCord/lastSuccessfulBuild/artifact/artifacts/VanillaCord.jar; __RETURN=$?
|
|
if [[ $__RETURN -eq 0 ]]; then
|
|
cd VanillaCord
|
|
echo Launching VanillaCord
|
|
"$java" -jar VanillaCord.jar "$version"; __RETURN=$?;
|
|
if [[ $__RETURN -eq 0 ]]; then
|
|
echo Copying Finished Jar...
|
|
cd ../
|
|
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
|
|
cp "VanillaCord/out/$version-bungee.jar" "$cache/Vanilla-$version.jar"
|
|
fi
|
|
cp "VanillaCord/out/$version-bungee.jar" Vanilla.jar
|
|
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
|
|
echo ERROR: Failed Downloading VanillaCord. Is ME1312.net down?
|
|
rm -Rf VanillaCord
|
|
rm -Rf "$0"
|
|
exit 3
|
|
fi
|
|
else
|
|
echo Copying Cached Jar...
|
|
cp "$cache/Vanilla-$version.jar" Vanilla.jar
|
|
echo Cleaning Up...
|
|
rm -Rf "$0"
|
|
exit 0
|
|
fi
|
|
exit 2 |