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