Return error code on failure with occ app:enable/disable
This commit is contained in:
parent
03965053c3
commit
016cf11134
|
@ -47,9 +47,11 @@ class Disable extends Command {
|
||||||
$output->writeln($appId . ' disabled');
|
$output->writeln($appId . ' disabled');
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
$output->writeln($e->getMessage());
|
$output->writeln($e->getMessage());
|
||||||
|
return 2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$output->writeln('No such app enabled: ' . $appId);
|
$output->writeln('No such app enabled: ' . $appId);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,10 @@ class Enable extends Command {
|
||||||
$appId = $input->getArgument('app-id');
|
$appId = $input->getArgument('app-id');
|
||||||
if (\OC_App::isEnabled($appId)) {
|
if (\OC_App::isEnabled($appId)) {
|
||||||
$output->writeln($appId . ' is already enabled');
|
$output->writeln($appId . ' is already enabled');
|
||||||
|
return 2;
|
||||||
} else if (!\OC_App::getAppPath($appId)) {
|
} else if (!\OC_App::getAppPath($appId)) {
|
||||||
$output->writeln($appId . ' not found');
|
$output->writeln($appId . ' not found');
|
||||||
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
\OC_App::enable($appId);
|
\OC_App::enable($appId);
|
||||||
$output->writeln($appId . ' enabled');
|
$output->writeln($appId . ' enabled');
|
||||||
|
|
Loading…
Reference in New Issue