From cb71b3bd2e3394ccecc2fb39965290ad9810ead3 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 16 Sep 2023 14:58:23 +0200 Subject: Ask user if they want to install neovim if not installed --- neovim.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'neovim.sh') 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 -- cgit v1.2.3