mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-29 10:43:53 +00:00
execute_function: execute function if exist
This commit is contained in:
parent
d23bb28ebc
commit
3c6b2d3b35
@ -11,7 +11,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v0.90-dev2-3-g483da5a
|
||||
#### $$VERSION$$ v0.90-dev2-4-gb60f33a
|
||||
#
|
||||
# Exit Codes:
|
||||
# - 0 sucess (hopefully)
|
||||
@ -198,6 +198,10 @@ _exists()
|
||||
[ "$(LC_ALL=C type -t "$1")" = "file" ]
|
||||
}
|
||||
|
||||
# execute function if exists
|
||||
_execute_function() {
|
||||
[ "$(LC_ALL=C type -t "${1}")" = "function" ] && "$@"
|
||||
}
|
||||
# returns true if function exist
|
||||
_is_function()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user