forked from skwp/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlibrary_loaders
More file actions
39 lines (33 loc) · 781 Bytes
/
library_loaders
File metadata and controls
39 lines (33 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- mode: sh -*-
# These should be called from within an include context.
include_files () {
for f in "$@"; do
_ignore_lib "$f" && continue
echo "# INCLUDED FROM: $f"
cat "$f"
echo # Needed in case file isn't terminated with a newline
done
}
load_libraries () {
for f in "$@"; do
_ignore_lib "$f" && continue
echo "lib = . $f"
done
}
include_lib_dirs () {
for d in "$@"; do
if [ -d "$d" ]; then
include_files "$d"/*
else
echo "$d missing" >&2
fi
done
}
########################################################################
# Private helpers
_ignore_lib () {
case "${1##*/}" in
*.orig|*~|README*|\#*\#) return 0 ;;
esac
return 1
}