diff --git a/update-cron.sh b/update-cron.sh index ec17a62..4d17c29 100755 --- a/update-cron.sh +++ b/update-cron.sh @@ -13,6 +13,8 @@ cmd="$SSH_ORIGINAL_COMMAND" publishToStage= publishToProduction=y +branch=develop + parseCMD() { while [ $# -gt 0 ] do @@ -24,6 +26,13 @@ parseCMD() { publishToStage=y publishToProduction= ;; + --branch) + branch="$1" + shift + ;; + --debug) + set -x + ;; *) echo "Unknown command $part" exit 1 @@ -49,8 +58,8 @@ cd "$src" echo "Fetching the latest git commits" git fetch -echo "Switching tothe latest branch commit" -git reset --hard origin/develop +echo "Switching to the latest commit on branch $branch" +git reset --hard "origin/$branch" echo "Updating NPM packages" npm ci