godep-save.sh: add sanity checks

This commit is contained in:
Dr. Stefan Schimanski
2017-07-07 18:39:11 +02:00
parent a9bf44101b
commit 918721078f
2 changed files with 31 additions and 24 deletions

View File

@@ -513,6 +513,14 @@ kube::util::ensure_godep_version() {
godep version
}
# Checks that the GOPATH is simple, i.e. consists only of one directory, not multiple.
kube::util::ensure_single_dir_gopath() {
if [[ "${GOPATH}" == *:* ]]; then
echo "GOPATH must consist of a single directory." 1>&2
exit 1
fi
}
# Checks whether there are any files matching pattern $2 changed between the
# current branch and upstream branch named by $1.
# Returns 1 (false) if there are no changes, 0 (true) if there are changes