Prechádzať zdrojové kódy

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

Samuel Jaffe 8 rokov pred
rodič
commit
fa6ca1cb72
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  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