forked from nvaccess/mrconfig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.library-loaders
42 lines (37 loc) · 968 Bytes
/
.library-loaders
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
40
41
42
# -*- mode: sh -*-
# Code recycled by Mesar Hameed <mhameed@src.gnome.org> for use with the nvda translation process.
# Author: Adam Spiers <dotfiles@adamspiers.org>
# https://github.com/aspiers/mr-config
#
# 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
}