install: fix install paths

This commit is contained in:
Charles Gould 2020-06-12 16:39:49 -05:00
parent 69cd5aba49
commit 24cc3140cf
2 changed files with 21 additions and 6 deletions

View File

@ -2,10 +2,14 @@
echo "***** INSTALL SHELL *****" echo "***** INSTALL SHELL *****"
SHELL_PATH='/usr/local/bin/fish' if [ -x "/usr/local/bin/fish" ]; then
SHELL_PATH="/usr/local/bin/fish"
if [ ! -x "$SHELL_PATH" ]; then elif [ -x "$HOME/.nix-profile/bin/fish" ]; then
echo "Cannot set login shell! $SHELL_PATH is not executable." 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 exit 1
fi fi

View File

@ -2,17 +2,28 @@
echo "***** INSTALL VIM PLUGINS *****" 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" VIM_PLUG="$HOME/.local/share/nvim/site/autoload/plug.vim"
if [ -f "$VIM_PLUG" ]; then if [ -f "$VIM_PLUG" ]; then
echo "Updating vim plugin manager..." echo "Updating vim plugin manager..."
echo "Updating vim plugins..." echo "Updating vim plugins..."
nvim --headless +PlugUpgrade +PlugUpdate +qall $VIM_PATH --headless +PlugUpgrade +PlugUpdate +qall
else else
echo "Installing vim plugin manager..." echo "Installing vim plugin manager..."
curl -fsSL -o "$VIM_PLUG" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim curl -fsSL -o "$VIM_PLUG" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "Installing vim plugins..." echo "Installing vim plugins..."
nvim --headless +PlugInstall +qall $VIM_PATH --headless +PlugInstall +qall
fi fi
echo echo