andypiper
11/25/2013 - 4:08 PM

Downloads bleeding-edge Go CLI for Cloud Foundry

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