浏览代码

Don't print 'Collecting garbage...' twice

When updating mailcow and it finished it printed 'Collecting garbage..,' twice since in docker_garbage() and before running the code we have the echo command.
Now it's printing the line before running docker_garbage()
Peter 7 年之前
父节点
当前提交
67adca4e05
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      update.sh

+ 1 - 1
update.sh

@@ -12,7 +12,6 @@ DATE=$(date +%Y-%m-%d_%H_%M_%S)
 BRANCH=$(git rev-parse --abbrev-ref HEAD)
 BRANCH=$(git rev-parse --abbrev-ref HEAD)
 
 
 docker_garbage() {
 docker_garbage() {
-  echo -e "\e[32mCollecting garbage...\e[0m"
   IMGS_TO_DELETE=()
   IMGS_TO_DELETE=()
   for container in $(grep -oP "image: \Kmailcow.+" docker-compose.yml); do
   for container in $(grep -oP "image: \Kmailcow.+" docker-compose.yml); do
     REPOSITORY=${container/:*}
     REPOSITORY=${container/:*}
@@ -74,6 +73,7 @@ while (($#)); do
       MERGE_STRATEGY=ours
       MERGE_STRATEGY=ours
     ;;
     ;;
     --gc)
     --gc)
+      echo -e "\e[32mCollecting garbage...\e[0m"
       docker_garbage
       docker_garbage
       exit 0
       exit 0
     ;;
     ;;