From bab32b3d2067316ad211270812a47c1bdb8e75cd Mon Sep 17 00:00:00 2001 From: MBorne Date: Sat, 25 Aug 2018 13:39:06 +0200 Subject: [PATCH] notify number of project found (closes #7), fixes ignore --- src/MBO/SatisGitlab/Command/GitlabToConfigCommand.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/MBO/SatisGitlab/Command/GitlabToConfigCommand.php b/src/MBO/SatisGitlab/Command/GitlabToConfigCommand.php index 81b180f..c32aeba 100644 --- a/src/MBO/SatisGitlab/Command/GitlabToConfigCommand.php +++ b/src/MBO/SatisGitlab/Command/GitlabToConfigCommand.php @@ -19,6 +19,8 @@ use MBO\SatisGitlab\Git\ClientOptions; use MBO\SatisGitlab\Git\GitlabProject; use MBO\SatisGitlab\Filter\FilterCollection; + +use MBO\SatisGitlab\Filter\IgnoreRegexpFilter; use MBO\SatisGitlab\Filter\IncludeIfHasFileFilter; @@ -171,6 +173,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { /* * Scan gitlab pages until no more projects are found */ + $projectCount = 0; for ($page = 1; $page <= self::MAX_PAGES; $page++) { $findOptions['page'] = $page; $projects = $client->find($findOptions); @@ -206,6 +209,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { } /* add project to satis config */ + $projectCount++; $logger->info($this->createProjectMessage( $project, "$projectName:*" @@ -225,6 +229,13 @@ protected function execute(InputInterface $input, OutputInterface $output) { } } + /* notify number of project found */ + if ( $projectCount == 0 ){ + $logger->error("No project found!"); + }else{ + $logger->info(sprintf("Number of project found : %s",$projectCount)); + } + /* * Write resulting config */