]> git.donarmstrong.com Git - zsh.git/blob - .zsh/sourcedir
do not source *.old files
[zsh.git] / .zsh / sourcedir
1 # sourcedir
2 #
3 # Defines helper function to source files in a directory
4 #
5 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
6 # Released under the terms of the Artistic Licence 2.0
7 #
8 # Source repository: http://git.madduck.net/v/etc/zsh.git
9 #
10
11 . $ZDOTDIR/logging
12
13 sourcedir() {
14   if [ ! -d "$1" ]; then
15     return 1
16   fi
17   debug "sourcing directory ${1#$ZDOTDIR/}"
18   for f in "$1"/*(.N); do
19     case "$f" in
20       *~|*.bak|*.old|*.sw?|*.zwc|*.disabled) continue;;
21     esac
22     debug "  sourcing file $f"
23     . "$f"
24   done
25 }
26
27 # vim:ft=zsh