Return error code on failure with occ app:enable/disable

This commit is contained in:
Vincent Petry 2015-08-18 12:48:03 +02:00
parent 03965053c3
commit 016cf11134
2 changed files with 4 additions and 0 deletions

View File

@ -47,9 +47,11 @@ class Disable extends Command {
$output->writeln($appId . ' disabled');
} catch(\Exception $e) {
$output->writeln($e->getMessage());
return 2;
}
} else {
$output->writeln('No such app enabled: ' . $appId);
return 1;
}
}
}

View File

@ -43,8 +43,10 @@ class Enable extends Command {
$appId = $input->getArgument('app-id');
if (\OC_App::isEnabled($appId)) {
$output->writeln($appId . ' is already enabled');
return 2;
} else if (!\OC_App::getAppPath($appId)) {
$output->writeln($appId . ' not found');
return 1;
} else {
\OC_App::enable($appId);
$output->writeln($appId . ' enabled');