install: check dependencies before running
This commit is contained in:
parent
56ab8011fe
commit
08cd87e019
1 changed files with 10 additions and 0 deletions
10
install.sh
10
install.sh
|
@ -17,6 +17,7 @@ main() {
|
||||||
*) usage; exit 1;;
|
*) usage; exit 1;;
|
||||||
esac done
|
esac done
|
||||||
|
|
||||||
|
check_dependencies
|
||||||
greeting
|
greeting
|
||||||
make_dirs
|
make_dirs
|
||||||
stow_home
|
stow_home
|
||||||
|
@ -25,6 +26,15 @@ main() {
|
||||||
nvim_plugins
|
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() {
|
greeting() {
|
||||||
dry_run && {
|
dry_run && {
|
||||||
warn "Performing dry run (use -f to actually make changes)."
|
warn "Performing dry run (use -f to actually make changes)."
|
||||||
|
|
Loading…
Add table
Reference in a new issue