From f31b8245e7239a4e062708f1169baea412013e8e Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Fri, 3 Aug 2018 20:58:38 -0700 Subject: [PATCH] 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 --- scripts/validate/dep.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/validate/dep.sh b/scripts/validate/dep.sh index ab03f5063..fd110b785 100755 --- a/scripts/validate/dep.sh +++ b/scripts/validate/dep.sh @@ -1,7 +1,9 @@ +#!/bin/bash validate_dep() { - dep ensure - nChanges=$(git status --porcelain -u | wc -l) + dep ensure || return $? + # 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 ] } @@ -11,6 +13,7 @@ validate_dep || { 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 'Check Gopkg.toml and Gopkg.lock' - git diff Gopkg.toml Gopkg.lock + git status --porcelain -u + dep version exit $ret } \ No newline at end of file