Adjust bashbrew to fail on dups

This commit is contained in:
Tianon Gravi 2014-12-31 17:54:28 -07:00
parent f69ffa8e4f
commit 166a52934b
1 changed files with 7 additions and 0 deletions

View File

@ -179,6 +179,13 @@ for repoTag in "${repos[@]}"; do
tags=() tags=()
for line in "${repoTagLines[@]}"; do for line in "${repoTagLines[@]}"; do
tag="$(echo "$line" | awk -F ': +' '{ print $1 }')" tag="$(echo "$line" | awk -F ': +' '{ print $1 }')"
for parsedRepoTag in "${tags[@]}"; do
if [ "$repo:$tag" = "$parsedRepoTag" ]; then
echo >&2 "error: tag '$tag' is duplicated in '${cmd[@]}'"
exit 1
fi
done
repoDir="$(echo "$line" | awk -F ': +' '{ print $2 }')" repoDir="$(echo "$line" | awk -F ': +' '{ print $2 }')"
gitUrl="${repoDir%%@*}" gitUrl="${repoDir%%@*}"