Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide non-zero exit codes on failure #143

Merged
merged 1 commit into from
Sep 6, 2017
Merged

provide non-zero exit codes on failure #143

merged 1 commit into from
Sep 6, 2017

Conversation

patrickjahns
Copy link
Contributor

Motivation

OCC market commands would always return 0 as exit code, even if a failure occured. This PR is related to #133 to provide non-zero exit codes (exit-code 1 on failure). When a failure occured

Tested manually:

$ php occ market:upgrade theme-enterprise
theme-enterprise: Installing new version 2.0.0 ...
theme-enterprise: No marketplace connection
$ echo $?
1

@@ -89,7 +92,8 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$output->writeln("$appId: App installed.");
}
} catch (\Exception $ex) {
$output->writeln("$appId: {$ex->getMessage()}");
$output->writeln("<error> $appId: {$ex->getMessage()} </error>");
$this->exitCode = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the tabs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@PVince81 PVince81 merged commit 6e189cd into master Sep 6, 2017
@PVince81 PVince81 deleted the occ_exit_codes branch September 6, 2017 16:29
@PVince81
Copy link
Contributor

PVince81 commented Sep 6, 2017

please backport to stable10: submit a new PR with the same commits (cherry-pick) but to target branch "stable10"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants