simplified the code. re-learned the lessons from my previous custom markdown pre processing. much better...

This commit is contained in:
2024-11-18 10:02:13 -06:00
parent c08375b657
commit 3350a05b3e
34 changed files with 107 additions and 287 deletions

View File

@@ -0,0 +1,23 @@
#!/bin/bash
function error_out()
{
echo "Bailing out. See above for reason...."
exit 1
}
function handle_failure() {
local lineno=$1
local fn=$2
local exitstatus=$3
local msg=$4
local lineno_fns=${0% 0}
if [[ "$lineno_fns" != "-1" ]] ; then
lineno="${lineno} ${lineno_fns}"
fi
echo "${BASH_SOURCE[0]}: Function: ${fn} Line Number : [${lineno}] Failed with status ${exitstatus}: $msg"
}
trap 'handle_failure "${BASH_LINENO[*]}" "$LINENO" "${FUNCNAME[*]:-script}" "$?" "$BASH_COMMAND"' ERR