-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
40 lines (32 loc) · 975 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
{
HEROKU_CLIENT_URL="https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client.tgz"
echo "This script requires superuser access to install software."
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
# run inside sudo
sudo sh <<SCRIPT
# download and extract the client tarball
rm -rf /usr/local/heroku
mkdir -p /usr/local/heroku
cd /usr/local/heroku
if [ -z "$(which wget)" ]; then
curl -s $HEROKU_CLIENT_URL | tar xz
else
wget -qO- $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
case "$PATH" in
*/usr/local/heroku/bin*)
echo "Installation complete"
;;
*)
echo "Add the Heroku CLI to your PATH using:"
echo "$ echo 'PATH=\"/usr/local/heroku/bin:\$PATH\"' >> ~/.profile"
;;
esac
}