Created
May 15, 2023 21:06
-
-
Save anthonydahanne/7abc41640d22c335d00a28ef1ab03e46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://stackoverflow.com/a/67638584/24069 | |
# read each item in the JSON array to an item in the Bash array | |
set +x | |
readarray -t my_array < <(jq --raw-output '.[]' $1) | |
# iterate through the Bash array | |
for item in "${my_array[@]}"; do | |
git clone [email protected]:$item.git &>/dev/null | |
cd ${item#*/} | |
go test -v ./... -coverprofile=coverage.out &>/dev/null | |
echo "$item: $(go tool cover -func=coverage.out | tail -n 1 | awk '{print $NF}')" | |
cd .. | |
rm -rf ${item#*/} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment