Last active
September 21, 2022 13:42
-
-
Save vyuh/031c866fcb35c5ec5f6904e0f7b18d1c to your computer and use it in GitHub Desktop.
Install heroku without sudo on linux
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 | |
{ | |
HEROKU_CLIENT_URL="https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client.tgz" | |
sh <<SCRIPT | |
# set appropriate HEROKU_DIR env variable | |
# default is ~/.local/heroku | |
# download and extract the client tarball | |
rm -rf "${HEROKU_DIR:=~/.local/heroku}" | |
mkdir -p "$HEROKU_DIR" | |
cd "$HEROKU_DIR" | |
if [ -z "$(which wget)" ]; then | |
curl $HEROKU_CLIENT_URL | tar xz | |
else | |
wget -O- $HEROKU_CLIENT_URL | tar xz | |
fi | |
mv heroku-client/* . | |
rmdir heroku-client | |
SCRIPT | |
# remind the user to add to $PATH if they don't already have it | |
echo "Add the Heroku CLI to your PATH using:" | |
echo "$ echo 'PATH=\"$HEROKU_DIR/heroku/bin:\$PATH\"' >> ~/.profile" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment