aboutsummaryrefslogtreecommitdiffstats
path: root/lib/functions.sh
blob: 99a896273f9a326097e1a2566bc6ebfdb2a82558 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

function has()
{
    local command_name="${1}"; shift;

    set +o errexit
    hash "${command_name}" > /dev/null 2>&1;
    if [ 0 -eq ${?} ];
    then
        set -o errexit
        return 0;
    fi

    set -o errexit
    return 1;
}