2
0
Эх сурвалжийг харах

Merge pull request #4741 from maljes/master

Modified branch switch in generate_config.sh
Niklas Meyer 3 жил өмнө
parent
commit
5b30dce609
1 өөрчлөгдсөн 11 нэмэгдсэн , 4 устгасан
  1. 11 4
      generate_config.sh

+ 11 - 4
generate_config.sh

@@ -141,15 +141,22 @@ echo "Available Branches:"
 echo "- master branch (stable updates) | default, recommended [1]"
 echo "- master branch (stable updates) | default, recommended [1]"
 echo "- nightly branch (unstable updates, testing) | not-production ready [2]"
 echo "- nightly branch (unstable updates, testing) | not-production ready [2]"
 sleep 1
 sleep 1
-read -r -p  "Choose the Branch with it´s number [1/2] " branch
+
+while [ -z "${MAILCOW_BRANCH}" ]; do
+  read -r -p  "Choose the Branch with it´s number [1/2] " branch
   case $branch in
   case $branch in
     [2])
     [2])
-      git_branch="nightly"
+      MAILCOW_BRANCH="nightly"
       ;;
       ;;
     *)
     *)
-      git_branch="master"
+      MAILCOW_BRANCH="master"
     ;;
     ;;
   esac
   esac
+done
+
+if [ ! -z "${MAILCOW_BRANCH}" ]; then
+  git_branch=${MAILCOW_BRANCH}
+fi
 
 
 git fetch --all
 git fetch --all
 git checkout -f $git_branch
 git checkout -f $git_branch
@@ -458,4 +465,4 @@ else
   echo '  $MAILCOW_UPDATEDAT='$(date +%s)';' >> data/web/inc/app_info.inc.php
   echo '  $MAILCOW_UPDATEDAT='$(date +%s)';' >> data/web/inc/app_info.inc.php
   echo '?>' >> data/web/inc/app_info.inc.php
   echo '?>' >> data/web/inc/app_info.inc.php
   echo -e "\e[33mCannot determine current git repository version...\e[0m"
   echo -e "\e[33mCannot determine current git repository version...\e[0m"
-fi
+fi