Don't try to run hack/verify-staging-* on dirty repository

This commit is contained in:
Dr. Stefan Schimanski
2017-03-08 13:56:34 +01:00
parent fa0387c9fe
commit c128e4686a
4 changed files with 17 additions and 102 deletions

View File

@@ -453,12 +453,18 @@ kube::util::godep_restored() {
return 0
}
# Exits script if working directory is dirty.
# Exits script if working directory is dirty. If it's run interactively in the terminal
# the user can commit changes in a second terminal. This script will wait.
kube::util::ensure_clean_working_dir() {
if ! git diff --exit-code; then
echo -e "\nUnexpected dirty working directory."
exit 1
fi
while ! git diff HEAD --exit-code &>/dev/null; do
echo -e "\nUnexpected dirty working directory:\n"
git status -s | sed 's/^/ /'
if ! tty -s; then
exit 1
fi
echo -e "\nCommit your changes in another terminal and then continue here by pressing enter."
read
done 1>&2
}
# Ensure that the given godep version is installed and in the path