Skip to content

Instantly share code, notes, and snippets.

@dzuluaga
Last active March 8, 2019 20:14
Show Gist options
  • Save dzuluaga/80df9a5316b56c19da982054e335468a to your computer and use it in GitHub Desktop.
Save dzuluaga/80df9a5316b56c19da982054e335468a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Replaces the current existing of Gradle with 5.2.1
# Run this script directly from the command line
#
# $ curl "https://gist.githubusercontent.com/dzuluaga/80df9a5316b56c19da982054e335468a/raw/update-gradle-cloud-shell.sh?$(date +%s)" | sudo bash
echo 'Downloading Gradle...'
curl https://downloads.gradle.org/distributions/gradle-5.2.1-bin.zip -o gradle-5.2.1-bin.zip
echo 'Removing gradle from default location /opt...'
sudo rm -rf /opt/gradle
echo 'Unzipping Gradle...'
sudo unzip gradle-5.2.1-bin.zip -d /opt
echo 'Renaming Gradle directory...'
sudo mv /opt/gradle-5.2.1 /opt/gradle
echo 'Update PATH'
export PATH=$PATH:/opt/gradle/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment