1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/scripts/check-uncommitted-vendor-files.sh

15 lines
387 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
GOPROXY="https://gocenter.io" GOSUMDB=off GO111MODULE=on go mod tidy
untracked_files=$(git ls-files --others --exclude-standard | wc -l)
diff_stat=$(git diff --shortstat)
if [[ "${untracked_files}" -ne 0 || -n "${diff_stat}" ]]; then
echo 'Untracked or diff in tracked vendor files found. Please run "go mod tidy" and commit the changes'
exit 1
fi