Update dep validation to only check the vendor dir

This helps make sure that different versions of dep don't give different
results.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff
2018-08-03 20:58:38 -07:00
parent f8609cfadc
commit f31b8245e7

View File

@@ -1,7 +1,9 @@
#!/bin/bash
validate_dep() { validate_dep() {
dep ensure dep ensure || return $?
nChanges=$(git status --porcelain -u | wc -l) # only check the vendor dir since different dep versions can cause changes to Gopkg files
nChanges=$(git status --porcelain -u ./vendor | wc -l)
[ $nChanges -eq 0 ] [ $nChanges -eq 0 ]
} }
@@ -11,6 +13,7 @@ validate_dep || {
echo '`dep ensure` was not run. Make sure dependency changes are committed to the repository.' echo '`dep ensure` was not run. Make sure dependency changes are committed to the repository.'
echo 'You may also need to check that all deps are pinned to a commit or tag instead of a branch or HEAD.' echo 'You may also need to check that all deps are pinned to a commit or tag instead of a branch or HEAD.'
echo 'Check Gopkg.toml and Gopkg.lock' echo 'Check Gopkg.toml and Gopkg.lock'
git diff Gopkg.toml Gopkg.lock git status --porcelain -u
dep version
exit $ret exit $ret
} }