Better Version of Bash/ZSH Dependency Tester

in code


Why test for one dependent executable when you can test for them all? It came in useful at work today.

function _has {
    for PROGRAM in "$@"; do
        if [[ $(which $PROGRAM > /dev/null 2>&1; echo $?) != 0 ]]; then
            return 1
        fi
    done

    return 0
}


instasort 4.0.1

in code


Your email address will not be published. Required fields are marked *