aboutsummaryrefslogtreecommitdiff
path: root/neovim.sh
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2023-09-16 14:58:23 +0200
committersrdusr <trevorgray@srdusr.com>2023-09-16 14:58:23 +0200
commitcb71b3bd2e3394ccecc2fb39965290ad9810ead3 (patch)
tree25c66589dbb579c74c132e8c92771dacc0d48689 /neovim.sh
parente22d899ce184f9d4765d99d617ecbf641d040f55 (diff)
downloaddotfiles-cb71b3bd2e3394ccecc2fb39965290ad9810ead3.tar.gz
dotfiles-cb71b3bd2e3394ccecc2fb39965290ad9810ead3.zip
Ask user if they want to install neovim if not installed
Diffstat (limited to 'neovim.sh')
-rwxr-xr-xneovim.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/neovim.sh b/neovim.sh
index ce448ea..5bfe5e7 100755
--- a/neovim.sh
+++ b/neovim.sh
@@ -311,11 +311,25 @@ check_dependencies
# Check for privilege escalation tools
check_privilege_tools
-# Check if Neovim is already installed
+# Check if Neovim is already installed and ask the user if want to install it
if check_neovim_installed; then
printf "${GREEN}Neovim is already installed!${NC}\n"
else
- choose_version
+ printf "${RED}Neovim is not installed.${NC}\n"
+ read -p "Install Neovim? (y/n): " install_choice
+
+ case $install_choice in
+ [Yy] )
+ choose_version
+ ;;
+ [Nn] )
+ echo "Exiting..."
+ exit
+ ;;
+ * )
+ handle_error "Invalid choice. Please enter 'y' for yes or 'n' for no."
+ ;;
+ esac
fi
# Function to check for updates and display breaking changes