From 9f305e760757633623a59997358e1014d548493f Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Thu, 21 Jan 2016 20:11:55 +0500 Subject: Fix install script. --- install.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 2684bd0..366fc89 100755 --- a/install.sh +++ b/install.sh @@ -37,16 +37,21 @@ create_link() { done } +check_command() { + if ! $(which "$1" >/dev/null 2>&1) ; then + echo "No $1." >&2 + if $(which "command-not-found" >/dev/null 2>&1) ; then + command-not-found "$1" + fi + fi +} + after_install() { mkdir -p $HOME/tmp/vim-undo $HOME/tmp/vim-backup mkdir -p $HOME/.mutt/cache touch $HOME/.mutt/aliases - if ! which ctags >/dev/null 2>&1; then - echo 'No ctags.' >&2 - fi - if ! which ag >/dev/null 2>&1; then - echo 'No ag.' >&2 - fi + check_command ctags + check_command ag } check_override() { -- cgit v1.2.3