diff --git a/karen b/karen index c53586c..09486d5 100755 --- a/karen +++ b/karen @@ -3,6 +3,17 @@ # karen watches for signals and executes triggers in the events dir # karen gets triggered a lot +check_dependencies () { + for cmd in "$@"; do + if ! command -v $cmd >/dev/null 2>&1; then + echo "This script requires \"${cmd}\" to be installed" + exit 1 + fi + done +} + +check_dependencies fswatch readlink dirname + if [[ -n "$1" ]]; then root_dir="$(readlink -f $1)" else