From 1f0d0fb9d0d26c2de9e52a95aa577e2ab3f6f0ec Mon Sep 17 00:00:00 2001 From: madumlao Date: Wed, 21 Apr 2021 16:11:34 +0800 Subject: [PATCH] Print warning if user cannot sudo to install packages --- install.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 2654b19..3c99174 100755 --- a/install.sh +++ b/install.sh @@ -4,7 +4,11 @@ cd "$APP_DIR" APP_DIR="$(pwd)" echo "Install zsh and friends" -sudo apt install zsh command-not-found +if sudo -l apt; then + sudo apt install zsh command-not-found +else + echo "Unable to autoinstall zsh and friends, please install manually" +fi echo "Install oh-my-zsh and plugins" if ! [ -d .oh-my-zsh ]; then @@ -33,8 +37,12 @@ for x in $(ls -a); do done IFS="$OLDIFS" -echo "Install vim and friends" -sudo apt install vim-nox git +echo "Install vim-nox and friends" +if sudo -l apt; then + sudo apt install vim-nox git +else + echo "Unable to autoinstall vim-nox and friends, please install manually" +fi mkdir -pv "$HOME/.vim/bundle" git clone https://github.com/VundleVim/Vundle.vim "$HOME/.vim/bundle/Vundle.vim" vim +PluginInstall +qall