sh: Format the git table in a single attribute set

This commit is contained in:
Rodrigo Arias 2021-04-01 17:48:10 +02:00
parent dbdcfea019
commit d2222f6868

View File

@ -15,11 +15,13 @@ EOF
exit 1
fi
echo 'gitTable = {'
echo " # Auto-generated with $progname on $(date --rfc-3339=date)"
echo '{'
echo " # Auto-generated with $progname on $(date --rfc-3339=date) for repo:"
echo " # $1"
echo
git ls-remote $1 'garlic/*' |\
sed 's@refs/heads/@@' |\
awk '{printf "\"%s\" = \"%s\";\n", $2, $1}' |\
column -t -o ' ' |\
sed 's/^/ /'
echo '};'
echo '}'