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

    return 0

March 20

in me

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