-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merges pre-push git hooks from develop into main (#96)
* [GIT SETUP] Tests pre push hook, disallowing direct push to develop Problem Solution Note * [GIT SETUP] Adds pre commit script Problem Solution Note * [GIT SETUP] Finalises pre commit hook script Problem Solution Note * [GIT SETUP] Changes git hook to pre push instead of pre commit Problem Solution Note * [GIT SETUP] Updates pre-push script comments Problem Solution Note * [GIT SETUP] Updates readme with git hook setup instructions Problem Solution Note * HOTFIX - Add Google Analytics (#97) Co-authored-by: marcaufderheyde <[email protected]> --------- Co-authored-by: Marc Auf der Heyde <[email protected]> Co-authored-by: marcaufderheyde <[email protected]>
- Loading branch information
1 parent
a4d3b9d
commit 1efc5dd
Showing
7 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
echo "*****Running pre push build******" | ||
|
||
cmd="npm run build" | ||
|
||
#!/bin/bash | ||
|
||
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | ||
|
||
if [ 'develop' = ${current_branch} ] | ||
then | ||
echo "ERROR: Cannot push to develop. Switch to a different branch and create a pull request." | ||
exit 1 # push will not execute | ||
else | ||
eval $cmd | ||
result=$? | ||
if ! eval "$cmd"; then | ||
echo "failed $cmd" >&2 | ||
exit 1 | ||
fi | ||
fi | ||
exit 0 # push will execute |