소스 검색

Actually don't put a comma if there's only one element in the ignore list.

Samuel Jaffe 8 년 전
부모
커밋
fa6ca1cb72
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      profile-git

+ 3 - 1
profile-git

@@ -17,7 +17,9 @@ git-create() {
   local message="Initializing repository"
   if [[ $# -ge 1 ]]; then
     for i in "$@"; do git-ignore "${i}"; done
-    message+=" with ignore lists: [ $1$(printf ", %s" "${@:2}") ]"
+    message+=" with ignore lists: [ $1"
+    $# -eq 1 || message+="$(printf ", %s" "${@:2}")"
+    message+=" ]"
   fi
   maybe_do git-ignore-local
   git add .gitignore