diff --git a/bash/helpers.sh b/bash/helpers.sh index 644afda1..ed422140 100644 --- a/bash/helpers.sh +++ b/bash/helpers.sh @@ -51,4 +51,14 @@ start_server() { fi } +# Call functions from this script gracefully +if declare -f "$1" > /dev/null +then + # call arguments verbatim + "$@" +else + echo "utils.sh: '$1' is not a known function name." >&2 + exit 1 +fi +