From a0bd26f9e811461216ecfa90a504d7bd6af032b3 Mon Sep 17 00:00:00 2001
From: Brandon Rodriguez <brodriguez8774@gmail.com>
Date: Thu, 10 Nov 2022 20:53:19 -0500
Subject: [PATCH] Add more options to program entrypoint

---
 run.sh | 38 +++++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 9 deletions(-)

diff --git a/run.sh b/run.sh
index ec467c5..25df592 100755
--- a/run.sh
+++ b/run.sh
@@ -21,20 +21,23 @@ function main () {
     # Make sure user is not root user.
     check_is_not_user root
 
+    # Provide program summary help.
+    echo ""
+    echo -e "${text_blue}This script provides some quick and easy setup functions for a linux install.${text_reset}"
+    echo -e "${text_blue}For example, it can map all the \"standard\" user folders to an external drive,${text_reset}"
+    echo -e "${text_blue}or install the latest version of some very common software.${text_reset}"
+    echo -e "${text_blue}May not work with all versions of linux.${text_reset}"
+    echo ""
+
     # Run program loop.
     while [[ $run_script_loop == true ]]
     do
-        echo ""
-        echo -e "${text_blue}This script provides some quick and easy setup functions for a linux install.${text_reset}"
-        echo -e "${text_blue}For example, it can map all the \"standard\" user folders to an external drive,${text_reset}"
-        echo -e "${text_blue}or install the latest version of some very common software.${text_reset}"
-        echo -e "${text_blue}May not work with all versions of linux.${text_reset}"
-        echo ""
-
         # Display options.
         echo ""
         echo -e "${text_blue}Select an option:${text_reset}"
         echo -e "${text_cyan}1${text_reset}) Initialize Git"
+        echo -e "${text_cyan}2${text_reset}) Setup Local Database"
+        echo -e "${text_cyan}3${text_reset}) Install/Update Npm & NodeJs"
         echo -e "${text_cyan}0${text_reset}) Exit"
 
         # Get user input.
@@ -43,17 +46,34 @@ function main () {
         # Handle based on selected option.
         if [[ "${user_input}" == "1" ]]
         then
-            pwd
-            echo ""
             # Git initialization.
             ./initialize_git.sh
 
+        elif [[ "${user_input}" == "2" ]]
+        then
+            # Setup local database.
+            echo ""
+            echo -e "${text_blue}Sudo is required for installing/updating system files.${text_reset}"
+            echo -e "${text_blue}This may ask for your system password.${text_reset}"
+            get_user_confirmation "${text_blue}This will also trigger a general system update. Is this okay?${text_reset}"
+
+        elif [[ "${user_input}" == "3" ]]
+        then
+            # Install/Update Npm & NodeJs.
+            echo ""
+            echo -e "${text_blue}Sudo is required for installing/updating system files.${text_reset}"
+            echo -e "${text_blue}This may ask for your system password.${text_reset}"
+            get_user_confirmation "${text_blue}This will also trigger a general system update. Is this okay?${text_reset}"
+
         elif [[ "${user_input}" == "0" ]]
         then
+            # Exit program.
             echo ""
             echo -e "${text_blue}Exiting program.${text_reset}"
             run_script_loop=false
+
         else
+            # Handle unrecognized input.
             echo ""
             echo -e "${text_red}Unrecognized selection.${text_reset}"
         fi
-- 
GitLab