only use history_file if it exists
authorJoerg Jaspert <joerg@debian.org>
Fri, 10 May 2013 21:16:12 +0000 (23:16 +0200)
committerJoerg Jaspert <joerg@debian.org>
Fri, 10 May 2013 21:16:12 +0000 (23:16 +0200)
M .zsh/functions/_publish

.zsh/functions/_publish

index 206406c..ef532ab 100644 (file)
@@ -40,7 +40,11 @@ _publish() {
     compttl2=(${=compttl})
 
     local -a tags
-    tags=( ${${${"${(f)mapfile[$history_file]}"##* }%/*}##*/} )
+    if [[ -e ${history_file} ]]; then
+        tags=( ${${${"${(f)mapfile[$history_file]}"##* }%/*}##*/} )
+    else
+        tags=()
+    fi
 
     _arguments -s \
         '-8[Add a AddDefaultCharset UTF-8 .htaccess file.]' \