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 8f88144..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 @@ -75,6 +75,10 @@ public function process(IOInterface $io, array $libraries, $methodKey = null) } $method = $this->getMethod($methodKey); + if ($methodKey === VendorPlugin::METHOD_NONE) { + return false; + } + // Update all modules foreach ($libraries as $module) { // Skip this module if no exposure required @@ -96,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; } @@ -138,8 +144,8 @@ protected function getMethod($key) case JunctionMethod::NAME: return new JunctionMethod(); case VendorPlugin::METHOD_NONE: - // 'none' is forced to an empty chain - return new ChainedMethod([]); + // 'none' is forced to an empty chain (and doesn't run anyway) + return new ChainedMethod(); case VendorPlugin::METHOD_AUTO: // Default to safe-failover method if (Platform::isWindows()) {