Skip to content

Instantly share code, notes, and snippets.

@yutopp
Created October 19, 2015 12:41
Show Gist options
  • Save yutopp/df1086b6738909721417 to your computer and use it in GitHub Desktop.
Save yutopp/df1086b6738909721417 to your computer and use it in GitHub Desktop.
#!/bin/bash
# ref. https://www.parse.com/downloads/cloud_code/installer.sh
TMP_FILE=/tmp/parse.tmp
if [ -e ${TMP_FILE} ]; then
echo "Cleaning up from previous install failure"
rm -rf ${TMP_FILE}
fi
echo "Fetching latest version ..."
case `uname` in
"Linux" )
export latest=`curl -X GET https://api.parse.com/1/supported?version=latest|grep -Po '(\d.\d.\d)'`
export url="https://github.com/ParsePlatform/parse-cli/releases/download/release_${latest}/parse_linux"
;;
"Darwin" )
export latest=`curl -X GET https://api.parse.com/1/supported?version=latest|grep -Eo '(\d.\d.\d)'`
export url="https://github.com/ParsePlatform/parse-cli/releases/download/release_${latest}/parse"
;;
esac
curl --progress-bar --compressed -Lo ${TMP_FILE} ${url}
if [ ! -d /usr/local/bin ]; then
echo "Making /usr/local/bin"
sudo mkdir -p /usr/local/bin
fi
echo "Installing ..."
sudo mv /tmp/parse.tmp /usr/local/bin/parse
sudo chmod 755 /usr/local/bin/parse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment