summaryrefslogtreecommitdiff
path: root/functions/sourceall
blob: b63c58bddc29d719ea7e88c039fe4091a4dc73ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/zsh
local ext=
local f=
local p=

# calling `sourceall zsh` will source *.zsh, otherwise *
(( $# > 0 )) && ext=".$1"

for p in $apath
do
    [[ -d $p ]] || continue
    for f in $p/*$ext(.N)
    do
        [[ -r $f ]] && . $f
    done
done