#!/bin/sh
# . "$(dirname "$0")/_/husky.sh"


echo "===\n>> Pre-push Hook: Checking branch name..."

cd web

BRANCH=`git rev-parse --abbrev-ref HEAD`
PROTECTED_BRANCHES="^(main|test)"

if [[ "$BRANCH" =~ $PROTECTED_BRANCHES ]]
then
  echo "\n🚫 Cannot push to remote $BRANCH branch, please create your own branch and use PR."
fi

echo ">> Finish checking branch name.\n==="

exit 0
