diff --git a/install.sh b/install.sh index 1f9d2eb..c09f281 100755 --- a/install.sh +++ b/install.sh @@ -17,6 +17,7 @@ main() { *) usage; exit 1;; esac done + check_dependencies greeting make_dirs stow_home @@ -25,6 +26,15 @@ main() { nvim_plugins } +check_dependencies() { + for cmd in stow readlink; do + if ! command -v "$cmd" >/dev/null 2>&1; then + error "Dependency \`$cmd\` not found." + exit 1 + fi + done +} + greeting() { dry_run && { warn "Performing dry run (use -f to actually make changes)."