mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2025-04-11 08:31:51 +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.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.90-dev2-3-g483da5a
|
#### $$VERSION$$ v0.90-dev2-4-gb60f33a
|
||||||
#
|
#
|
||||||
# Exit Codes:
|
# Exit Codes:
|
||||||
# - 0 sucess (hopefully)
|
# - 0 sucess (hopefully)
|
||||||
@ -198,6 +198,10 @@ _exists()
|
|||||||
[ "$(LC_ALL=C type -t "$1")" = "file" ]
|
[ "$(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
|
# returns true if function exist
|
||||||
_is_function()
|
_is_function()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user