Correctly throwing error on unsatisfied dependency

This commit is contained in:
DarkCat09 2023-07-20 12:42:58 +04:00
parent 1751409f53
commit a17a7b0f7e

View file

@ -6,7 +6,11 @@ WORKDIR=$(pwd)
# ---
dep () {
which "$1" || (echo "$1 not found" && exit 1)
if ! which "$1" 2>/dev/null
then
echo "$1 not found"
exit 1
fi
}
clone () {