Fixes multiple matches selection

Signed-off-by: Tj Holowaychuk <tj@vision-media.ca>
This commit is contained in:
Jonhnny Weslley 2010-11-10 12:22:49 -03:00 committed by Tj Holowaychuk
parent a5392d54c3
commit 89e2047442

View file

@ -9,7 +9,7 @@ done
if [ ! -z "$template" ]; then
gitignoredir="`dirname $0`/../etc/gitignore"
selected_template=$(find $gitignoredir -type f -name *.gitignore | xargs -i basename {} .gitignore | grep -i $template)
selected_template=$(find $gitignoredir -type f -name *.gitignore | xargs -i basename {} .gitignore | sort | grep $template)
count=$(echo $selected_template | wc -w)
case "$count" in
0) echo "The pattern '$template' does not match any available templates." && exit 1;;