1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-04 08:00:05 +00:00

chore: adding hook script to prevent accidental commits to master

This commit is contained in:
munja
2021-12-07 16:58:23 +00:00
parent 596624c1bf
commit 6c8165601d

View File

@@ -1,2 +1,11 @@
#!/bin/sh
sasjs lint
sasjs lint
# Avoid commits to the master branch
BRANCH=`git rev-parse --abbrev-ref HEAD`
if [[ "$BRANCH" =~ ^(master|main|develop)$ ]]; then
echo "You are on branch $BRANCH. Are you sure you want to commit to this branch?"
echo "If so, commit with -n to bypass the pre-commit hook."
exit 1
fi