Skip to content

Instantly share code, notes, and snippets.

@chadrien
Created November 5, 2013 14:42
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 chadrien/7320025 to your computer and use it in GitHub Desktop.
Save chadrien/7320025 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
if [[ -z "$1" ]]; then
echo "You must chose an action [list, use]"
exit
fi
cd ~/repositories/cakephp/cakephp/
git fetch > /dev/null
case "$1" in
"list")
git tag
;;
"use")
if [[ -z "$2" ]]; then
echo "You must give a CakePHP version as argument. Eg: cvm 2.3"
fi
git co "$2" > /dev/null
if [[ "$?" == "0" ]]; then
echo "CakePHP version switched to $2"
else
echo "An error occured, does CakePHP version $2 really exists?"
fi
;;
*)
echo "Unknown option. Available options are [list, use]"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment