Created
March 13, 2015 16:01
-
-
Save ryanwarsaw/a74af698ca4e3b45206b to your computer and use it in GitHub Desktop.
v2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BuildToolsAddress="https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar" | |
AphelionAddress="[link redacted]" | |
cat logo.txt | |
if [ -f BuildTools.jar ]; then | |
while true; do | |
read -p "Would you like to update your version of BuildTools? (y/n): " yn | |
case ${yn} in | |
[Yy]* ) rm -rf BuildTools.jar; curl -o BuildTools.jar ${BuildToolsAddress}; break;; | |
[Nn]* ) break;; | |
* ) echo "Invalid response type, you must enter either (Yy/Nn) as your response.";; | |
esac | |
done | |
fi | |
if [ ! -f BuildTools.jar ]; then | |
echo "Couldn't find BuildTools on your machine, downloading it now..." | |
curl -o BuildTools.jar ${BuildToolsAddress}; | |
fi | |
echo "" | |
echo "Running BuildTools... please keep in mind you must have git and java installed on your machine to use BuildTools." | |
echo "You can test to see if you have these tools on your machine, by doing 'git --version' & 'java -version'." | |
echo "If either one of these don't exist, stop this program and install them, and set the paths accordingly." | |
echo "" | |
echo "Now attempting to run BuildTools.jar, you may be prompted to enter your password before continuing." | |
sudo java -jar BuildTools.jar | |
sudo rm -rf BuildTools.log.txt | |
sudo rm -rf work | |
sudo rm -rf Spigot | |
sudo rm -rf Craftbukkit | |
sudo rm -rf Bukkit | |
sudo rm -rf BuildData | |
sudo rm -rf apache-maven-3.2.3 | |
if [ -d ~/.m2/repository/org/spigotmc/ ]; then | |
while true; do | |
read -p "Would you like to remove older versions of Spigot from maven? (y/n): " yn | |
case ${yn} in | |
[Yy]* ) rm -rf ~/.m2/repository/org/spigotmc/; break;; | |
[Nn]* ) echo "Skipping deletion of older versions of Spigot from your machine."; break;; | |
* ) echo "Invalid response type, you must enter either (Yy/Nn) as your response.";; | |
esac | |
done | |
fi | |
if [ -d ~/.m2/repository/org/bukkit/ ]; then | |
while true; do | |
read -p "Would you like to remove older versions of Craftbukkit from maven? (y/n): " yn | |
case ${yn} in | |
[Yy]* ) rm -rf ~/.m2/repository/org/bukkit/; break;; | |
[Nn]* ) echo "Skipping deletion of older versions of Craftbukkit from your machine."; break;; | |
* ) echo "Invalid response type, you must enter either (Yy/Nn) as your response.";; | |
esac | |
done | |
fi | |
if [ -d ~/.m2/repository/me/hfox/ ]; then | |
while true; do | |
read -p "Would you like to remove older versions of Aphelion from maven? (y/n): " yn | |
case ${yn} in | |
[Yy]* ) rm -rf ~/.m2/repository/me/hfox/; break;; | |
[Nn]* ) echo "Skipping deletion of older versions of Aphelion from your machine."; break;; | |
* ) echo "Invalid response type, you must enter either (Yy/Nn) as your response.";; | |
esac | |
done | |
fi | |
curl -o aphelion-bukkit-1.1.3-SNAPSHOT.jar ${AphelionAddress}; | |
echo "Installing Spigot 1.8.3 in your local maven repository..." | |
mvn install:install-file -Dfile=spigot-1.8.3.jar -DgroupId=org.spigotmc -DartifactId=spigot -Dversion=1.8.3-R0.1-SNAPSHOT -Dpackaging=jar | |
echo "Installing Craftbukkit 1.8.3 in your local maven repository..." | |
mvn install:install-file -Dfile=craftbukkit-1.8.3.jar -DgroupId=org.bukkit -DartifactId=craftbukkit -Dversion=1.8.3-R0.1-SNAPSHOT -Dpackaging=jar | |
echo "Installing Aphelion for Spigot/Craftbukkit 1.8.3 in your local maven repository..." | |
mvn install:install-file -Dfile=aphelion-bukkit-1.1.3-SNAPSHOT.jar -DgroupId=me.hfox -DartifactId=aphelion -Dversion=1.1.3-SNAPSHOT -Dpackaging=jar | |
echo "Completed installing all dependencies to your .m2/repositories directory!" | |
sudo rm -rf BuildTools.jar | |
sudo rm -rf spigot-1.8.3.jar | |
sudo rm -rf aphelion-bukkit-1.1.3-SNAPSHOT.jar | |
sudo rm -rf craftbukkit-1.8.3.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment