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

Merge pull request #106 from sasjs/hook

chore: adding hook script to prevent accidental commits to master
This commit is contained in:
Allan Bowe
2021-12-07 17:44:00 +00:00
committed by GitHub

View File

@@ -1,2 +1,11 @@
#!/bin/sh #!/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