#!/bin/bash printf "\nRunning pre-commit hook ..." current_branch=$(git symbolic-ref --short HEAD) if [[ "$current_branch" == "main" || "$current_branch" == "master" ]]; then printf "\n🔴 Direct commits to '$current_branch' are not allowed !" printf "\nPlease commit to a feature branch and open a pull request." exit 1 fi printf "\n✅ Pre-commit checks passed !" exit 0