Skip to content

Commit

Permalink
Stop completion message from displaying when no action is taken
Browse files Browse the repository at this point in the history
  • Loading branch information
Garion Herman committed Sep 19, 2019
1 parent 32ba6fd commit fc0a43e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/Console/VendorExposeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
}
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/VendorExposeTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function process(IOInterface $io, array $libraries, $methodKey = null)
{
// No-op
if (empty($libraries)) {
return;
return false;
}

// Setup root folder
Expand All @@ -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
Expand All @@ -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;
}


Expand Down

0 comments on commit fc0a43e

Please sign in to comment.