Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-03-05 22:29:54 +03:00
parent 5d0a593026
commit c21fb0bbf8

View File

@ -226,7 +226,8 @@ getCaption(){
# XXX EXPERIMENTAL index template variables...
declare -A TEMPLATE_INDEX
templateVars(){
if [ -z ${TEMPLATE_INDEX[$1]} ] ; then
# cache the vars...
if [ ${TEMPLATE_INDEX[$1]+_} ] ; then
TEMPLATE_INDEX[$1]=$(cat "$1" \
| grep -o '\${[A-Z0-9]\+}' \
| sed 's/\${\(.*\)}/\1/g' \
@ -234,11 +235,10 @@ templateVars(){
fi
echo ${TEMPLATE_INDEX[$1]}
}
# cache all template vars...
indexTemplates(){
#echo indexing templates...
local tpl
for tpl in "${TEMPLATE_PATH}"/* ; do
#echo ${tpl}...
templateVars "${tpl}" > /dev/null
done
}