balena-cli/automation/catch-uncommitted-output
Tim Perry a36f765f1b Catch uncommitted build output automatically in Travis
Connects-To: #573
Change-Type: patch
2017-08-31 20:12:06 +08:00

16 lines
394 B
Bash
Executable File

#!/bin/sh
npm run build
if ! git diff HEAD --exit-code ; then
echo '\n** Uncommitted changes found after build - FAIL **'
exit 1
elif test -n "$(git ls-files --exclude-standard --others)" ; then
echo '\n** Untracked uncommitted files found after build: **'
git ls-files --exclude-standard --others
echo '** FAIL **'
exit 2
else
echo '\nNo unexpected changes after build, all good.'
fi