[AUTOCONFIG][NEOVIM] Add force params
This commit is contained in:
parent
392fac949c
commit
f9fe112400
2 changed files with 25 additions and 11 deletions
4
.env
4
.env
|
@ -9,4 +9,6 @@ WM=awesome
|
||||||
|
|
||||||
# Install neovim with custom configuration
|
# Install neovim with custom configuration
|
||||||
WITH_NEOVIM=yes
|
WITH_NEOVIM=yes
|
||||||
WITH_LAZYGIT=yes
|
# Possible value = yes | no | force
|
||||||
|
WITH_CUSTOM_NEOVIM_CONFIG=yes
|
||||||
|
WITH_CUSTOM_LAZYGIT_CONFIG=yes
|
||||||
|
|
|
@ -8,18 +8,30 @@ if [[ "$WITH_NEOVIM" == 'yes' ]]; then
|
||||||
echo '[INFO] Neovim already installed'
|
echo '[INFO] Neovim already installed'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$WITH_LAZYGIT" == 'yes' && ! -d "$HOME/.config/lazygit" ]]; then
|
if [[ "$WITH_CUSTOM_LAZYGIT_CONFIG" == 'yes' || "$WITH_CUSTOM_LAZYGIT_CONFIG" == 'force' ]]; then
|
||||||
ln -s "$CWD/configs/lazygit" "$HOME/.config/lazygit"
|
if [[ -d "$HOME/.config/lazygit" && "$WITH_CUSTOM_LAZYGIT_CONFIG" == 'force' ]]; then
|
||||||
echo "[INFO] Neovim config linked with symbolic link : $CWD/configs/lazygit -> $HOME/.config/lazygit"
|
rm -rf "$HOME/.config/lazygit"
|
||||||
|
echo '[INFO] Lazygit config removed | Forced by environment variable'
|
||||||
|
fi
|
||||||
|
if [[ ! -d "$HOME/.config/lazygit" ]]; then
|
||||||
|
ln -s "$CWD/configs/lazygit" "$HOME/.config/lazygit"
|
||||||
|
echo "[INFO] Lazygit config linked with symbolic link : $CWD/configs/lazygit -> $HOME/.config/lazygit"
|
||||||
|
else
|
||||||
|
echo '[INFO] Lazygit config already linked'
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -d "$HOME/.config/nvim" ]]; then
|
|
||||||
ln -s "$CWD/configs/nvim" "$HOME/.config/nvim"
|
|
||||||
echo "[INFO] Neovim config linked with symbolic link : $CWD/configs/nvim -> $HOME/.config/nvim"
|
|
||||||
|
|
||||||
install_package ripgrep fd dart lazygit rust-analyzer lldb
|
if [[ "$WITH_CUSTOM_NEOVIM_CONFIG" == 'yes' || "$WITH_CUSTOM_NEOVIM_CONFIG" == 'force' ]]; then
|
||||||
else
|
if [[ -d "$HOME/.config/nvim" && "$WITH_CUSTOM_NEOVIM_CONFIG" == 'force' ]]; then
|
||||||
echo '[INFO] Neovim config already linked'
|
rm -rf "$HOME/.config/nvim"
|
||||||
|
echo '[INFO] Neovim config removed | Forced by environment variable'
|
||||||
|
fi
|
||||||
|
if [[ ! -d "$HOME/.config/nvim" ]]; then
|
||||||
|
ln -s "$CWD/configs/nvim" "$HOME/.config/nvim"
|
||||||
|
echo "[INFO] Neovim config linked with symbolic link : $CWD/configs/nvim -> $HOME/.config/nvim"
|
||||||
|
else
|
||||||
|
echo '[INFO] Neovim config already linked'
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo '[INFO] WITH_NEOVIM not equals to yes. Ignoring...'
|
echo '[INFO] WITH_NEOVIM not equals to yes. Ignoring...'
|
||||||
|
|
Loading…
Reference in a new issue