From 2d06fbc1c421c0ff155674cf3a9c6d82181a4571 Mon Sep 17 00:00:00 2001
From: Sebastien Curt <sebastien.curt@tetras-libre.fr>
Date: Fri, 15 Apr 2022 11:07:11 +0200
Subject: [PATCH] Miminize console log for projects update

---
 src/Command/UpdateAllProjects.php | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/Command/UpdateAllProjects.php b/src/Command/UpdateAllProjects.php
index 144166a..3de51c0 100644
--- a/src/Command/UpdateAllProjects.php
+++ b/src/Command/UpdateAllProjects.php
@@ -108,7 +108,6 @@ class UpdateAllProjects extends Command
 
             $this->updateProjectDirectory(
                 $output,
-                $php_files_count_per_projects,
                 $current_legacy_path,
                 $this->capsule_prototype_root
             );
@@ -145,22 +144,16 @@ class UpdateAllProjects extends Command
 
     /**
      * @param ConsoleOutputInterface $output
-     * @param int $php_files_count_per_projects
      * @param string $current_legacy_path
      * @param string $capsule_prototype_root
      * @return void
      */
     protected function updateProjectDirectory(
         ConsoleOutputInterface $output,
-        int $php_files_count_per_projects,
         string $current_legacy_path,
         string $capsule_prototype_root
     ): void {
-        $progress_bar = new ProgressBar($output->section(), $php_files_count_per_projects);
-        $progress_bar->setFormat('project_update_message');
-        $progress_bar->setMessage($current_legacy_path, 'project');
-
-        $progress_bar->start();
+        $output->writeln("Updating project :{$current_legacy_path}");
 
         // override index.html
         $this->file_system->copy(
@@ -168,7 +161,6 @@ class UpdateAllProjects extends Command
             Path::normalize($current_legacy_path . '/index.html'),
             true
         );
-        $progress_bar->advance();
 
         // override php files
         $this->file_system->mirror(
@@ -177,7 +169,7 @@ class UpdateAllProjects extends Command
             null,
             ['override' => true, 'delete' => true]
         );
-        $progress_bar->advance($php_files_count_per_projects - 1);
-        $progress_bar->finish();
+
+        $output->writeln("Updating project :{$current_legacy_path} ---> DONE");
     }
 }
-- 
GitLab