Skip to content

Commit

Permalink
Update pre-commit script
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusnjak committed May 28, 2022
1 parent 853a836 commit 6273ee9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions scripts/git-hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
PATH=$PATH:/usr/local/bin/
source ./scripts/colors.sh

if [[ -f BUILD_IS_BROKEN ]] ; then
echo Current build is broken, refusing to commit.
exit 1
fi
function validate_build() {
if [[ -f BUILD_IS_BROKEN ]] ; then
red
echo Current build is broken, refusing to commit.
exit 1
fi
}

validate_build

folder="manifests/"
rm -rf ${folder}/*

./scripts/build.sh clusters

validate_build

if test $(git status --porcelain -- "${folder}" | grep "^.\w" | wc -l) != 0
then
red
Expand Down

0 comments on commit 6273ee9

Please sign in to comment.