balena-cli/automation/catch-uncommitted-output

17 lines
401 B
Bash
Executable File

#!/bin/sh
set -e
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