-if [ -n "$ZDOTDIR" ]; then
- rm -f $ZDOTDIR/**/*.zwc(D.N) $ZVARDIR/**/*.zwc(.N)
- for f ($ZDOTDIR/.*(@) $ZDOTDIR/*(D.,@) $ZDOTDIR/**/*(.) $ZVARDIR/comp*(.)) \
- zcompile $f
+if [ -n "$ZDOTDIR" ] && [ -d "$ZDOTDIR" ]; then
+ rm -f $ZDOTDIR/**/*.zwc(D.N)
+ for f ($ZDOTDIR/*[^$ZDOTDIR/.gitignore](D.,@) $ZDOTDIR/**/*(.)) zcompile $f
+fi
+
+if [ -n "$ZVARDIR" ] && [ -d "$ZVARDIR" ]; then
+ rm -f $ZVARDIR/**/*.zwc(.N)
+ for f ($ZVARDIR/comp*(.)) zcompile $f