]> git.donarmstrong.com Git - zsh.git/blobdiff - .zsh/zprofile/40_zcompile
delete .zwc.old files
[zsh.git] / .zsh / zprofile / 40_zcompile
index b3a3e264ae454098abc55f015dde699b0448118a..174a757d8c024b31ad1c7402554f1a6aad36ec29 100644 (file)
@@ -8,10 +8,15 @@
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
-if [ -n "$ZDOTDIR" ]; then
-  command rm -f $ZDOTDIR/**/*.zwc(.N) $ZDOTDIR/**/.*.zwc(.N) ZVAR/**/*.zwc(.N)
-  for f ($ZDOTDIR/.*(@) $ZDOTDIR/*(.) $ZDOTDIR/**/*(.) $ZVAR/comp-$HOST) \
-    zcompile $f
+if [ -n "$ZDOTDIR" ] && [ -d "$ZDOTDIR" ]; then
+  rm -f $ZDOTDIR/**/*.zwc{,.old}(D.N)
+  for f ($ZDOTDIR/*(D.,@) $ZDOTDIR/**/*(.)) \
+    [[ $f:t != .gitignore ]] && zcompile $f
+fi
+
+if [ -n "$ZVARDIR" ] && [ -d "$ZVARDIR" ]; then
+  rm -f $ZVARDIR/**/*.zwc{,.old}(.N)
+  for f ($ZVARDIR/comp*(.N)) zcompile $f
 fi
 
 # vim:ft=zsh