-
-
Save chadrien/7320025 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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