Skip to content

Commit

Permalink
Set return code for SetModeCommand
Browse files Browse the repository at this point in the history
In case of running the `bin/magento deploy:mode:set production` command
in a shell script this will return an error code 129 and all other
commands after this will not be executed.
  • Loading branch information
Marvin Caspar committed Jun 3, 2016
1 parent a5fa3af commit c60a251
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/code/Magento/Deploy/Console/Command/SetModeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
throw new LocalizedException(__('Cannot switch into given mode "%1"', $toMode));
}
$output->writeln('Enabled ' . $toMode . ' mode.');

return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
} catch (\Exception $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
Expand Down

0 comments on commit c60a251

Please sign in to comment.