Browse Source

feat(musare.sh): Add env config change check to update

Owen Diffey 1 week ago
parent
commit
1f0bb8fd6a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      musare.sh

+ 5 - 1
musare.sh

@@ -420,8 +420,9 @@ handleUpdate()
     musareshChange=$(echo "${updated}" | grep "musare.sh")
     musareshChange=$(echo "${updated}" | grep "musare.sh")
     dbChange=$(echo "${updated}" | grep "backend/logic/db/schemas")
     dbChange=$(echo "${updated}" | grep "backend/logic/db/schemas")
     bcChange=$(echo "${updated}" | grep "backend/config/default.json")
     bcChange=$(echo "${updated}" | grep "backend/config/default.json")
+    envChange=$(echo "${updated}" | grep ".env.example")
     set -e
     set -e
-    if [[ ( $2 == "auto" && -z $dbChange && -z $bcChange && -z $musareshChange ) || -z $2 ]]; then
+    if [[ ( $2 == "auto" && -z $dbChange && -z $bcChange && -z $musareshChange && -z $envChange ) || -z $2 ]]; then
         if [[ -n $musareshChange && $(git diff @\{u\} -- musare.sh) != "" ]]; then
         if [[ -n $musareshChange && $(git diff @\{u\} -- musare.sh) != "" ]]; then
             if [[ $musareshModified != "" ]]; then
             if [[ $musareshModified != "" ]]; then
                 throw "musare.sh has been modified, please reset these changes and run the update command again to continue."
                 throw "musare.sh has been modified, please reset these changes and run the update command again to continue."
@@ -442,6 +443,9 @@ handleUpdate()
             if [[ -n $bcChange ]]; then
             if [[ -n $bcChange ]]; then
                 echo -e "${RED}Backend config has changed, please update!${NC}"
                 echo -e "${RED}Backend config has changed, please update!${NC}"
             fi
             fi
+            if [[ -n $envChange ]]; then
+                echo -e "${RED}Environment config has changed, please update!${NC}"
+            fi
         fi
         fi
     elif [[ $2 == "auto" ]]; then
     elif [[ $2 == "auto" ]]; then
         throw "Auto Update Failed! musare.sh, database and/or config has changed!"
         throw "Auto Update Failed! musare.sh, database and/or config has changed!"