diff --git a/.travis.yml b/.travis.yml index 8fa89666..777c536e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 $? diff --git a/checkgit.sh b/checkgit.sh new file mode 100755 index 00000000..ee29eb4b --- /dev/null +++ b/checkgit.sh @@ -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;