Skip to content

Commit

Permalink
🐛 FIX: bugfix for #14: added ability to call a function
Browse files Browse the repository at this point in the history
  • Loading branch information
apolopena committed Feb 2, 2021
1 parent 2e1037d commit 44dc2ea
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bash/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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


0 comments on commit 44dc2ea

Please sign in to comment.