Skip to content

Commit dff8990

Browse files
redbeampraveenkumar
authored andcommitted
verify-vendor.sh: fix early exit on non-zero exit code
If `git diff --exit-code vendor go.mod go.sum` found a difference, it exited with exit code 1 and caused the whole script to exit prematurely due to `set -o errexit`, skipping the printing of the final message to the user.
1 parent 452d393 commit dff8990

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

verify-vendor.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ make vendor
1616
go mod verify
1717

1818
echo "Diffing $(pwd)"
19-
git diff --exit-code vendor go.mod go.sum
2019

21-
if [[ $? -eq 0 ]]
22-
then
20+
if git diff --exit-code vendor go.mod go.sum; then
2321
echo "$(pwd) up to date."
2422
else
2523
echo "$(pwd) is out of date. Please run make vendor"

0 commit comments

Comments
 (0)