« Back to Index

curl -s -L bit.ly/<your_bitly> | bash <- bit.ly should point to a private gist that pulls content from a public S3 bucket

View original Gist on GitHub

install script.sh

#!/bin/bash

function os_error {
  echo "ERROR: This script only installs <name_of_binary> on OSX (Darwin_x86_64) at the moment.  Visit Github to download the executable"
  exit 1
}

echo -e "Installing <NAME_OF_BINARY>:\n"

echo -n " > Checking OS compatibility... "
if [ "$(uname -s)" != "Darwin" -o "$(uname -m)" != "x86_64" ]; then
  os_error
else
  echo "DONE"
fi

echo -n " > Fetching binary from S3... "
curl -s -L https://<location_in_s3> > /usr/local/bin/<name_of_binary>
echo "DONE"

echo " > Save to /usr/local/bin/<name_of_binary>... DONE"

echo -n " > Add execute permissions... "
chmod +x /usr/local/bin/<name_of_binary>
echo -e "DONE\n"

echo -e "Installation complete.\n"

echo "Try: <name_of_binary> --help"