Skip to content

Instantly share code, notes, and snippets.

@mattrasband
Last active April 26, 2019 20:57
Show Gist options
  • Save mattrasband/4ca37c7b03a7d02a3f7f5851a22c0eed to your computer and use it in GitHub Desktop.
Save mattrasband/4ca37c7b03a7d02a3f7f5851a22c0eed to your computer and use it in GitHub Desktop.
Install Heroku CLI on Linux
#!/usr/bin/env bash
#############################################################################
# Utility script to install (and update) embedded heroku from their tarball.
#############################################################################
set -eox pipefail
if [ -L /usr/local/bin/heroku ]; then
echo "Heroku symbolic link found, removing"
sudo rm /usr/local/bin/heroku
fi
if [ -d /opt/heroku ]; then
echo "Heroku directory already exists, trashing it."
sudo rm -rf /opt/heroku
fi
curl https://cli-assets.heroku.com/heroku-linux-x64.tar.gz | sudo tar zx -C /opt/
sudo ln -s /opt/heroku/bin/heroku /usr/local/bin/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment