From a89be52faca7d3dbd187f90f696b35a5d0378b03 Mon Sep 17 00:00:00 2001 From: lostbean Date: Wed, 6 Dec 2023 13:21:35 -0300 Subject: [PATCH] add script to tidy all go modules --- scripts/go-tidy-all.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 scripts/go-tidy-all.sh diff --git a/scripts/go-tidy-all.sh b/scripts/go-tidy-all.sh new file mode 100755 index 0000000000..90d4e8eeea --- /dev/null +++ b/scripts/go-tidy-all.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -euo pipefail # Bash "strict mode" +script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +root_dirpath="$(dirname "${script_dirpath}")" + +find $root_dirpath -type f -name 'go.mod' -exec sh -c 'dir=$(dirname "{}") && cd "$dir" && echo "$dir" && go mod tidy' \; \ No newline at end of file