浏览代码

Merge pull request #382 from infosiftr/fail-on-dups

Adjust bashbrew to fail on dups
Tianon Gravi 11 年之前
父节点
当前提交
8c52a31fdf
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      bashbrew/bashbrew.sh

+ 7 - 0
bashbrew/bashbrew.sh

@@ -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%%@*}"