From 8549c98a0c942f64feac0a0880cbc803483cf423 Mon Sep 17 00:00:00 2001 From: Daria Danilenko Date: Fri, 14 Jan 2022 13:47:58 +0100 Subject: [PATCH] Fix go mod repo to run only on current git project Use git ls-files to ignore submodules --- lib/cmd-repo-mod.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cmd-repo-mod.bash b/lib/cmd-repo-mod.bash index 25c91d2..db0326f 100644 --- a/lib/cmd-repo-mod.bash +++ b/lib/cmd-repo-mod.bash @@ -11,7 +11,7 @@ export GO111MODULE=on error_code=0 # Assume parent folder of go.mod is module root folder # -for sub in $(find . -name go.mod -not -path '*/vendor/*' -exec dirname "{}" ';' | sort -u); do +for sub in $(git ls-files | grep '/go\.mod$' | grep -v "/vendor/" | xargs -n1 dirname | sort -u); do pushd "${sub}" > /dev/null || exit 1 if [ "${error_on_output:-}" -eq 1 ]; then output=$("${cmd[@]}" "${OPTIONS[@]}" 2>&1)