From 44dc2ea407d80bcc547a2c2c2ec1f648ee614e60 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Tue, 2 Feb 2021 00:36:19 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20bugfix=20for=20#14:=20add?= =?UTF-8?q?ed=20ability=20to=20call=20a=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/helpers.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 +