Skip to content

Instantly share code, notes, and snippets.

@petejkim
Created June 4, 2013 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petejkim/5709932 to your computer and use it in GitHub Desktop.
Save petejkim/5709932 to your computer and use it in GitHub Desktop.
Parse installer for Nitrous.IO boxes
#!/bin/bash
TMP_FILE=/tmp/parse.tmp
if [ -e /tmp/parse.tmp ]; then
echo "Cleaning up from previous install failure"
rm -f /tmp/parse.tmp
fi
echo "Fetching latest version ..."
curl --progress-bar https://www.parse.com/downloads/cloud_code/parse -o /tmp/parse.tmp
if [ ! -d $HOME/.bin ]; then
echo "Making $HOME/.bin"
mkdir -p $HOME/.bin
fi
echo "Installing ..."
mv /tmp/parse.tmp $HOME/.bin/parse
chmod 755 $HOME/.bin/parse
echo "Adding $HOME/.bin to PATH"
HOMEBIN_PATH='export PATH=$HOME/.bin:$PATH'
if [ -e $HOME/.bash_profile ]; then
grep -Fqx "$HOMEBIN_PATH" $HOME/.bash_profile || echo $HOMEBIN_PATH >> .bash_profile
fi
if [ -e $HOME/.zshrc ]; then
grep -Fqx "$HOMEBIN_PATH" $HOME/.zshrc || echo $HOMEBIN_PATH >> .zshrc
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment