2019-06-17 05:13:48 +02:00
|
|
|
# SubCreator SpongeVanilla Build Script
|
2018-10-01 23:44:37 +02:00
|
|
|
#
|
|
|
|
#!/usr/bin/env bash
|
2019-06-17 05:13:48 +02:00
|
|
|
if [[ -z "$sp_version" ]]
|
2018-10-01 23:44:37 +02:00
|
|
|
then
|
|
|
|
echo ERROR: No Build Version Supplied
|
|
|
|
rm -Rf "$0"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
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
|
|
|
|
}
|
2020-08-23 04:11:05 +02:00
|
|
|
function __Restore() {
|
|
|
|
if [[ -f "Sponge.old.jar.x" ]]; then
|
|
|
|
if [[ -f "Sponge.jar" ]]; then
|
|
|
|
rm -Rf Sponge.jar
|
|
|
|
fi
|
|
|
|
mv Sponge.old.jar.x Sponge.jar
|
|
|
|
fi
|
|
|
|
}
|
2018-10-01 23:44:37 +02:00
|
|
|
echo Downloading SpongeVanilla...
|
2019-06-17 05:13:48 +02:00
|
|
|
if [[ -f "Sponge.jar" ]]; then
|
|
|
|
if [[ -f "Sponge.old.jar.x" ]]; then
|
|
|
|
rm -Rf Sponge.old.jar.x
|
|
|
|
fi
|
|
|
|
mv Sponge.jar Sponge.old.jar.x
|
|
|
|
fi
|
2019-01-14 01:52:44 +01:00
|
|
|
__DL Sponge.jar "https://repo.spongepowered.org/maven/org/spongepowered/spongevanilla/$sp_version/spongevanilla-$sp_version.jar"; __RETURN=$?
|
2019-06-17 05:13:48 +02:00
|
|
|
if [[ $__RETURN -eq 0 ]]; then
|
2018-10-01 23:44:37 +02:00
|
|
|
echo Cleaning Up...
|
|
|
|
rm -Rf "$0"
|
|
|
|
exit 0
|
|
|
|
else
|
2020-06-12 07:45:49 +02:00
|
|
|
echo ERROR: Failed downloading Sponge. Is SpongePowered.org down?
|
2020-08-23 04:11:05 +02:00
|
|
|
__Restore
|
2018-10-01 23:44:37 +02:00
|
|
|
rm -Rf "$0"
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
exit 2
|