Last active
December 29, 2015 08:29
-
-
Save andypiper/7643792 to your computer and use it in GitHub Desktop.
Downloads bleeding-edge Go CLI for Cloud Foundry
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/bash | |
if [ -f /usr/local/bin/cf ] | |
then | |
version=`/usr/local/bin/cf -v | cut -d " " -f 3` | |
echo 'Current version of cf installed is ' $version | |
fi | |
echo 'Downloading latest binary' | |
curl http://go-cli.s3.amazonaws.com/cf-darwin-amd64.tgz -o cf-darwin-amd64.tgz -s | |
echo 'Uncompressing...' | |
tar -xf cf-darwin-amd64.tgz | |
echo 'Moving binary to /usr/local/bin/' | |
mv cf /usr/local/bin/ | |
if [ -f /usr/local/bin/gcf ] | |
then | |
echo 'Removing old gcf binary - will symlink gcf to new cf command' | |
rm -f /usr/local/bin/gcf | |
fi | |
ln -s /usr/local/bin/cf /usr/local/bin/gcf # for convenience | |
echo 'Deleting the tarball' | |
rm cf-darwin-amd64.tgz | |
newversion=`/usr/local/bin/cf -v | cut -d " " -f 3` | |
echo 'Installed cf version ' $newversion |
name change, now does some version checking as well.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now works better if your Mac doesn't have wget installed :-)