From fc0a43ea607e57d1deaf1b484ca35816ced30872 Mon Sep 17 00:00:00 2001 From: Garion Herman Date: Fri, 20 Sep 2019 09:29:46 +1200 Subject: [PATCH] Stop completion message from displaying when no action is taken --- src/Console/VendorExposeCommand.php | 7 ++++--- src/VendorExposeTask.php | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Console/VendorExposeCommand.php b/src/Console/VendorExposeCommand.php index c316b0a..d198557 100644 --- a/src/Console/VendorExposeCommand.php +++ b/src/Console/VendorExposeCommand.php @@ -50,10 +50,11 @@ public function execute(InputInterface $input, OutputInterface $output) // Expose all modules $method = $input->getArgument('method'); $task = new VendorExposeTask($this->getProjectPath(), new Filesystem(), $basePublicPath); - $task->process($io, $modules, $method); - // Success - $io->write("All modules updated!"); + if ($task->process($io, $modules, $method)) { + // Success + $io->write("All modules updated!"); + } } /** diff --git a/src/VendorExposeTask.php b/src/VendorExposeTask.php index 64eacbe..450b8aa 100644 --- a/src/VendorExposeTask.php +++ b/src/VendorExposeTask.php @@ -63,7 +63,7 @@ public function process(IOInterface $io, array $libraries, $methodKey = null) { // No-op if (empty($libraries)) { - return; + return false; } // Setup root folder @@ -76,7 +76,7 @@ public function process(IOInterface $io, array $libraries, $methodKey = null) $method = $this->getMethod($methodKey); if ($methodKey === VendorPlugin::METHOD_NONE) { - return; + return false; } // Update all modules @@ -100,6 +100,8 @@ public function process(IOInterface $io, array $libraries, $methodKey = null) // On success, write `.method` token to persist for subsequent updates $this->saveMethodKey($methodKey); + + return true; }