瀏覽代碼

Merge pull request #5552 from mailcow/staging

[Update.sh] Fix repo change when running in forced mode
Niklas Meyer 1 年之前
父節點
當前提交
979f5475c3
共有 1 個文件被更改,包括 8 次插入3 次删除
  1. 8 3
      update.sh

+ 8 - 3
update.sh

@@ -891,9 +891,14 @@ if [ "$CURRENT_REPO" != "$DEFAULT_REPO" ]; then
   echo "The Repository currently used is not the default Mailcow Repository."
   echo "The Repository currently used is not the default Mailcow Repository."
   echo "Currently Repository: $CURRENT_REPO"
   echo "Currently Repository: $CURRENT_REPO"
   echo "Default Repository:   $DEFAULT_REPO"
   echo "Default Repository:   $DEFAULT_REPO"
-  read -r -p "Should it be changed back to default? [y/N] " repo_response
-  if [[ "$repo_response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
-    git remote set-url origin $DEFAULT_REPO
+  if [ ! $FORCE ]; then
+    read -r -p "Should it be changed back to default? [y/N] " repo_response
+    if [[ "$repo_response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
+      git remote set-url origin $DEFAULT_REPO
+    fi
+  else
+      echo "Running in forced mode... setting Repo to default!"
+      git remote set-url origin $DEFAULT_REPO
   fi
   fi
 fi
 fi