Merge pull request #577 from eatdrinksleepcode/verify-no-changes

Check that there are no source file changes before building
This commit is contained in:
Peter Cottle 2019-05-01 11:43:25 -07:00 committed by GitHub
commit 5891d44796
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -11,4 +11,6 @@ cache:
directories:
- "node_modules"
script:
- ./checkgit.sh "Source files were modified before build; is yarn.lock out of sync with package.json?" || travis_terminate $?
- yarn grunt
- ./checkgit.sh "Source files were modified by the build" || travis_terminate $?

6
checkgit.sh Executable file
View file

@ -0,0 +1,6 @@
GIT_STATUS=$(git status --porcelain | wc -l )
if [[ GIT_STATUS -ne 0 ]]; then
echo "${1:-Source files were modified}"
git status
exit $GIT_STATUS
fi;