From 24cc3140cf6986dd4ce8950664662cc43aea2f42 Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Fri, 12 Jun 2020 16:39:49 -0500 Subject: [PATCH] install: fix install paths --- install/install-shell.sh | 12 ++++++++---- install/install-vim-plugins.sh | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/install/install-shell.sh b/install/install-shell.sh index acf1c11..45cd6f5 100755 --- a/install/install-shell.sh +++ b/install/install-shell.sh @@ -2,10 +2,14 @@ echo "***** INSTALL SHELL *****" -SHELL_PATH='/usr/local/bin/fish' - -if [ ! -x "$SHELL_PATH" ]; then - echo "Cannot set login shell! $SHELL_PATH is not executable." +if [ -x "/usr/local/bin/fish" ]; then + SHELL_PATH="/usr/local/bin/fish" +elif [ -x "$HOME/.nix-profile/bin/fish" ]; then + SHELL_PATH="$HOME/.nix-profile/bin/fish" +else + echo "Cannot set login shell! Tried the following paths:" + echo " - /usr/local/bin/fish" + echo " - $HOME/.nix-profile/bin/fish" exit 1 fi diff --git a/install/install-vim-plugins.sh b/install/install-vim-plugins.sh index 3e9fb2f..4e89277 100755 --- a/install/install-vim-plugins.sh +++ b/install/install-vim-plugins.sh @@ -2,17 +2,28 @@ echo "***** INSTALL VIM PLUGINS *****" +if [ -x "/usr/local/bin/nvim" ]; then + VIM_PATH="/usr/local/bin/nvim" +elif [ -x "$HOME/.nix-profile/bin/nvim" ]; then + VIM_PATH="$HOME/.nix-profile/bin/nvim" +else + echo "Cannot find vim! Tried the following paths:" + echo " - /usr/local/bin/nvim" + echo " - $HOME/.nix-profile/bin/nvim" + exit 1 +fi + VIM_PLUG="$HOME/.local/share/nvim/site/autoload/plug.vim" if [ -f "$VIM_PLUG" ]; then echo "Updating vim plugin manager..." echo "Updating vim plugins..." - nvim --headless +PlugUpgrade +PlugUpdate +qall + $VIM_PATH --headless +PlugUpgrade +PlugUpdate +qall else echo "Installing vim plugin manager..." curl -fsSL -o "$VIM_PLUG" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim echo "Installing vim plugins..." - nvim --headless +PlugInstall +qall + $VIM_PATH --headless +PlugInstall +qall fi echo