Skip to content

Instantly share code, notes, and snippets.

@andypiper
Last active December 29, 2015 08:29
Show Gist options
  • Save andypiper/7643792 to your computer and use it in GitHub Desktop.
Save andypiper/7643792 to your computer and use it in GitHub Desktop.
Downloads bleeding-edge Go CLI for Cloud Foundry
#!/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
@andypiper
Copy link
Author

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