Added choice between stable and dev branch

Added a prompt to choose between downloading stable and development after the package manager validation and before the final confirmation prompt
This commit is contained in:
TurtleIdiot 2022-05-23 14:40:35 +01:00 committed by Melledy
parent 2b799958d2
commit 8459c82568
1 changed files with 17 additions and 1 deletions

View File

@ -38,11 +38,27 @@ valid_ip() {
# Checks for supported installer(s) (only apt-get for now :(, might add pacman in the future)
if is_command apt-get ; then
echo -e "Supported package manager found\n"
elif is_command pacman
else
echo "No supported package manager found"
exit
fi
BRANCH="stable" # Stable by default
# Allows choice between stable and dev branch
echo "Please select the branch you wish to install"
echo -e "!!NOTE!!: stable is the recommended brach.\ndevelopment is not guaranteed to work.\nUnless you have a reason to use development, pick stable"
select branch in "stable" "development" ; do
case $branch in
stable )
BRANCH="stable"
break;;
development )
BRANCH="development"
break;;
esac
done
INSTALLER_DEPS="curl wget openssl unzip git"
GC_DEPS="mongodb openjdk-17-jre"
@ -74,7 +90,7 @@ echo "Done"
echo "Getting grasscutter..."
# Download and rename jar
wget -q --show-progress https://nightly.link/Grasscutters/Grasscutter/workflows/build/stable/Grasscutter.zip
wget -q --show-progress "https://nightly.link/Grasscutters/Grasscutter/workflows/build/$BRANCH/Grasscutter.zip"
unzip -qq Grasscutter.zip
mv $(find -name "grasscutter*.jar" -type f) grasscutter.jar