Created
February 7, 2016 15:22
-
-
Save phouverneyuff/c95bb94e6a258bb526ca to your computer and use it in GitHub Desktop.
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
if [ -z $1 ]; then | |
echo "Version not informed. E.G: './update-gradle.sh 2.8'" | |
exit 0 | |
fi | |
GRADLE_VERSION=$1 | |
GRADLE_FILE=gradle-${GRADLE_VERSION}-bin | |
GRADLE_LOCATION=/opt/gradle | |
sudo mkdir -p ${GRADLE_LOCATION} && cd ${GRADLE_LOCATION} | |
sudo wget https://downloads.gradle.org/distributions/${GRADLE_FILE}.zip | |
sudo unzip ${GRADLE_FILE}.zip | |
sudo rm -fr ${GRADLE_FILE}.zip | |
GRADLE_FILE=gradle-${GRADLE_VERSION} | |
sudo mv ${GRADLE_FILE} ${GRADLE_VERSION} | |
GRADLE_FILE=${GRADLE_VERSION} | |
sudo rm -fr ${GRADLE_LOCATION}/latest | |
sudo ln -s ${GRADLE_LOCATION}/${GRADLE_FILE} ${GRADLE_LOCATION}/latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment