metrics.sh/lib/utils/functions.sh

11 lines
176 B
Bash

#!/bin/sh
# this is bad, but `declare -f -F` is not portable
is_function () {
type $1 2> /dev/null | grep -q 'function$'
}
command_exists () {
type $1 > /dev/null 2>&1
}