diff --git a/deploy.sh b/deploy.sh index 41f491d..b6a22a6 100755 --- a/deploy.sh +++ b/deploy.sh @@ -16,8 +16,8 @@ if [ -f "${DEPLOY_DESTINATION_FILE}" ]; then fi # Check if the correct usage is respected -if [ $# -ne 2 ]; then - echo "Usage: $0 " +if [ $# -le 2 ]; then + echo "Usage: $0 [branch/tag]" echo echo "Current settings:" echo "- Source ยท ${DEPLOY_SOURCE}" @@ -27,3 +27,9 @@ fi echo "deploying ..." git clone "${DEPLOY_SOURCE}/${1}" "${DEPLOY_DESTINATION}/${2}" + +if [ $# -eq 3 ]; then + pushd "${DEPLOY_DESTINATION}/${2}" + git checkout "${3}" + popd +fi