From 016cf11134e4b55b85e52581d48bfef00a54149e Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 18 Aug 2015 12:48:03 +0200 Subject: [PATCH] Return error code on failure with occ app:enable/disable --- core/command/app/disable.php | 2 ++ core/command/app/enable.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/command/app/disable.php b/core/command/app/disable.php index 21a88f0a92..fc634bb32c 100644 --- a/core/command/app/disable.php +++ b/core/command/app/disable.php @@ -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; } } } diff --git a/core/command/app/enable.php b/core/command/app/enable.php index 2e68cfa97f..d3733f0f13 100644 --- a/core/command/app/enable.php +++ b/core/command/app/enable.php @@ -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');