1414echo " =================================================================================================================="
1515echo
1616
17- # Step 0 : Detect OS
17+ # Step 1 : Detect OS
1818echo " Step 1: Detecting Operating System"
1919echo " ------------------------------------------------------------------------------------------------------------------"
2020OS=" "
@@ -60,7 +60,7 @@ echo "INFO: System checks passed! Continuing with installation."
6060echo
6161echo
6262
63- # Step 1 : Check if Neovim is installed
63+ # Step 2 : Check if Neovim is installed
6464echo " Step 2: Checking if Neovim is already installed"
6565echo " ------------------------------------------------------------------------------------------------------------------"
6666if command -v nvim > /dev/null 2>&1 ; then
107107echo
108108echo
109109
110- # Step 1.5 : Checking for System Dependencies
110+ # Step 3 : Checking for System Dependencies
111111echo " Step 3: Checking for GarudaNvim Dependencies"
112112echo " ------------------------------------------------------------------------------------------------------------------"
113113echo " Checking for the following dependencies on your system:"
114- echo " Node, Python, Ripgrep, Lazygit, Htop"
115- echo " Though these are not strictly needed, it's recommended to have them for a seamless GarudaNvim experience."
114+ echo " Node, Python, Ripgrep, Lazygit, Htop, Hack Nerd Font "
115+ echo " Though these are not strictly required, having them provides a seamless GarudaNvim experience."
116116echo
117117
118118dependencies=(" node" " python3" " rg" " lazygit" " htop" )
@@ -127,11 +127,14 @@ for dep in "${dependencies[@]}"; do
127127 fi
128128done
129129
130+ # Display information on installed and missing dependencies
130131if [ ${# missing_dependencies[@]} -eq 0 ]; then
131- echo " INFO: All dependencies are already installed."
132+ echo " INFO: All essential dependencies are already installed."
132133else
133134 echo " INFO: Found installed dependencies: ${installed_dependencies[*]} "
134135 echo " INFO: Missing dependencies: ${missing_dependencies[*]} "
136+
137+ # Prompt to install missing dependencies
135138 for dep in " ${missing_dependencies[@]} " ; do
136139 echo
137140 read -p " Would you like to install $dep ? (y/n): " install_choice
@@ -185,11 +188,60 @@ else
185188 fi
186189 done
187190fi
191+
192+ # Check and install Hack Nerd Font
193+ echo
194+ echo " Checking for Hack Nerd Font..."
195+ FONT_NAME=" Hack Nerd Font"
196+ if [ " $OS " = " macOS" ]; then
197+ FONT_DIR=" $HOME /Library/Fonts"
198+ else
199+ FONT_DIR=" $HOME /.local/share/fonts"
200+ fi
201+ FONT_PATH=" $FONT_DIR /HackNerdFont-Regular.ttf"
202+
203+ if [ -f " $FONT_PATH " ]; then
204+ echo " INFO: $FONT_NAME is already installed."
205+ else
206+ echo " $FONT_NAME is not installed on your system."
207+ echo " It is recommended for GarudaNvim to display icons correctly and enhance readability."
208+ echo
209+ read -p " Would you like to install $FONT_NAME ? (y/n): " install_font_choice
210+
211+ if [ " $install_font_choice " = " y" ]; then
212+ echo
213+ echo " INFO: Installing $FONT_NAME ..."
214+
215+ # Ensure the font directory exists
216+ mkdir -p " $FONT_DIR "
217+
218+ # Download Hack Nerd Font
219+ curl -fLo " $FONT_DIR /Hack.zip" https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Hack.zip
220+
221+ # Unzip and install the font
222+ unzip -o " $FONT_DIR /Hack.zip" -d " $FONT_DIR "
223+ rm " $FONT_DIR /Hack.zip"
224+
225+ # Refresh the font cache for Linux
226+ if [ " $OS " != " macOS" ]; then
227+ if command -v fc-cache > /dev/null 2>&1 ; then
228+ fc-cache -f -v
229+ fi
230+ fi
231+
232+ echo
233+ echo " INFO: $FONT_NAME has been successfully installed!"
234+ else
235+ echo
236+ echo " INFO: You chose not to install $FONT_NAME ."
237+ echo " GarudaNvim may not display icons correctly without it."
238+ fi
239+ fi
188240echo
189241echo
190242
191243
192- # Step 2 : Check for existing Neovim configuration
244+ # Step 4 : Check for existing Neovim configuration
193245echo " Step 4: Checking for existing Neovim configuration in ~/.config/nvim"
194246echo " ------------------------------------------------------------------------------------------------------------------"
195247if [ -d ~ /.config/nvim ]; then
236288echo
237289echo
238290
239- # Step 3 : Cloning GarudaNvim repository
291+ # Step 5 : Cloning GarudaNvim repository
240292echo " Step 5: Installing GarudaNvim to ~/.config/nvim"
241293echo " ------------------------------------------------------------------------------------------------------------------"
242294# Clone the repository
0 commit comments