From dd9ce7c770d3a6892681ff97484632adcf30cfd0 Mon Sep 17 00:00:00 2001
From: "Eng.Taha Shokri"
Date: Mon, 11 Mar 2024 16:03:04 +0330
Subject: [PATCH] Update: Adding ability to install NVM
1 - Adding ability to install NVM ( node version manager )
2 - Updating read me file
---
mahimana.sh | 19 +++++++++++++++++++
readme.md | 3 ++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/mahimana.sh b/mahimana.sh
index 7572f74..5ea3ea0 100644
--- a/mahimana.sh
+++ b/mahimana.sh
@@ -494,6 +494,21 @@ getSSLWithNginx() {
fi
}
+# Install NVM
+installNVM() {
+ printf "${Blue} 🚀 Starting install NVM ... ${NC} \n";
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh > /dev/null 2>&1 & spinner | bash > /dev/null 2>&1 & spinner;
+ printf "${Green} 🎉 NVM is installed ${NC} \n";
+ # Ask for reopen shell
+ read -p "Do you want to reopen shell? (y/n): " -n 1 -r
+ echo # (optional) move to a new line
+ if [[ $REPLY =~ ^[Yy]$ ]]
+ then
+ # Reopen shell
+ exec $SHELL
+ fi
+}
+
# Main
main() {
clear
@@ -511,6 +526,7 @@ main() {
printf "${Cyan}7. Change Hostname ${Purple} ($(showHostname)) ${Red}[Server]${NC}\n"
printf "${Cyan}8. Install Nginx ${Red}[Server]${NC}\n"
printf "${Cyan}9. Get SSL for domain with Nginx ${Red}[Server]${NC}\n"
+ printf "${Cyan}10. Install NVM (Node Version Manager)${NC}\n"
read -p "Enter your choice: " choice
@@ -542,6 +558,9 @@ main() {
9)
getSSLWithNginx
;;
+ 10)
+ installNVM
+ ;;
*)
printf "${Red}Invalid choice. Exiting.${NC}\n"
exit 1
diff --git a/readme.md b/readme.md
index ecd4f3f..e4a45e2 100644
--- a/readme.md
+++ b/readme.md
@@ -8,7 +8,7 @@
" alt="shields" />
Screen Shot
-
+
🧐 Features
@@ -23,6 +23,7 @@ Here're some of the project's best features:
* Change Hostname
* Install Nginx
* Get SSL with domain and Nginx
+* Install NVM (Node Version Manager)
🛠️ Usage