|
@@ -180,6 +180,32 @@ saturnin__conf() {
|
180
|
180
|
return "${PIPESTATUS[0]}"
|
181
|
181
|
}
|
182
|
182
|
|
|
183
|
+saturnin__conf_find() {
|
|
184
|
+ #
|
|
185
|
+ # Find all existing instances of sub-path $1 on $SATURNIN_CONF_PATH
|
|
186
|
+ #
|
|
187
|
+ # Go through all elements of $SATURNIN_CONF_PATH, looking for file
|
|
188
|
+ # on sub-path $1. Print each existing path, ignore rest.
|
|
189
|
+ #
|
|
190
|
+ # If at least one path was found, return zero. Otherwise, return one,
|
|
191
|
+ # or more in case of error.
|
|
192
|
+ #
|
|
193
|
+ local file=$1 # sub-path to find
|
|
194
|
+ local trydir # each item of $SATURNIN_CONF_PATH
|
|
195
|
+ local trypath # each combined path
|
|
196
|
+ debug -v SATURNIN_CONF_PATH
|
|
197
|
+ echos "$SATURNIN_CONF_PATH" \
|
|
198
|
+ | tr ':' '\n' \
|
|
199
|
+ | while read -r trydir;
|
|
200
|
+ do
|
|
201
|
+ test -n "$trydir" || continue
|
|
202
|
+ trypath="$trydir/$file"
|
|
203
|
+ test -e "$trypath" || continue
|
|
204
|
+ echos "$trypath"
|
|
205
|
+ done \
|
|
206
|
+ | grep .
|
|
207
|
+}
|
|
208
|
+
|
183
|
209
|
saturnin__get() {
|
184
|
210
|
#
|
185
|
211
|
# Show Saturnin Internal info by key $1 and exit
|