From 2ab6c1670b73e19257727e1caff3ef4fb99efae7 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sun, 22 Sep 2024 18:04:12 +0200 Subject: [PATCH] Add nvim version check berfore installing (#586) * Added nvim version check * Moved the check to a func Co-authored-by: nnyyxxxx --------- Co-authored-by: nnyyxxxx --- .../applications-setup/Developer-tools/neovim-setup.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh index 07b14b91..b73d2db5 100755 --- a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh @@ -4,6 +4,15 @@ gitpath="$HOME/.local/share/neovim" +checkNeovimVer() { + # lazy.nvim requires nvim >= 0.8.0 + nvim_version=$(nvim --version | head -n 1 | awk '{print $2}') + if [ "$(printf "%s\n" "$nvim_version" "0.8.0" | sort -V | head -n 1)" != "0.8.0" ]; then + printf "%b\n" "${RED}Neovim version $nvim_version not supported.${RC}" + exit 1 + fi +} + cloneNeovim() { # Check if the dir exists before attempting to clone into it. if [ -d "$gitpath" ]; then @@ -54,6 +63,7 @@ linkNeovimConfig() { checkEnv checkEscalationTool installNeovim +checkNeovimVer cloneNeovim backupNeovimConfig linkNeovimConfig