File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 17
17
18
18
set -euo pipefail
19
19
20
-
21
20
# # @var SCRIPT_PATH
22
21
# # @brief path to where the script lives
23
22
declare SCRIPT_PATH
24
23
# shellcheck disable=SC2034
25
24
SCRIPT_PATH=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd -P) "
26
25
26
+ # # @var LIBRARY_PATH
27
+ # # @brief location where libraries to be included reside
28
+ declare LIBRARY_PATH
29
+ LIBRARY_PATH=" ${SCRIPT_PATH} /lib/"
27
30
28
31
# # @var DEFAULT_WORD
29
32
# # @brief default value for the 'word' CLI parameter
@@ -127,6 +130,24 @@ main() {
127
130
trap die ERR
128
131
129
132
133
+ # ##
134
+ # ## If there is a library directory (lib/) relative to the
135
+ # ## script's location by default), then attempt to source
136
+ # ## the *.bash files located there.
137
+ # ##
138
+
139
+
140
+ if [ -n " ${LIBRARY_PATH} " ] \
141
+ && [ -d " ${LIBRARY_PATH} " ] ; then
142
+ for library in " ${LIBRARY_PATH} " * .bash ; do
143
+ if [ -e " ${library} " ] ; then
144
+ # shellcheck disable=SC1090
145
+ . " ${library} "
146
+ fi
147
+ done
148
+ fi
149
+
150
+
130
151
# ##
131
152
# ## set values from their defaults here
132
153
# ##
You can’t perform that action at this time.
0 commit comments