From 63fd980db3bfdb754b55270703c711388546b21a Mon Sep 17 00:00:00 2001 From: Christoph Burschka Date: Mon, 9 Jan 2017 14:07:57 +0100 Subject: [PATCH 1/2] [config:import] return exit code on error (#3083) --- src/Command/Config/ImportCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Command/Config/ImportCommand.php b/src/Command/Config/ImportCommand.php index 0375d4548..3832469cc 100644 --- a/src/Command/Config/ImportCommand.php +++ b/src/Command/Config/ImportCommand.php @@ -106,6 +106,9 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($this->configImport($io, $storage_comparer)) { $io->success($this->trans('commands.config.import.messages.imported')); } + else { + return 1; + } } @@ -129,6 +132,7 @@ private function configImport(DrupalStyle $io, StorageComparer $storage_comparer try { $config_importer->import(); $io->info($this->trans('commands.config.import.messages.importing')); + return TRUE; } catch (ConfigImporterException $e) { $message = 'The import failed due for the following reasons:' . "\n"; $message .= implode("\n", $config_importer->getErrors()); From 06816395749c5dcce025cdaf19e50bf2a4aa9fa2 Mon Sep 17 00:00:00 2001 From: Christoph Burschka Date: Mon, 9 Jan 2017 15:33:43 +0100 Subject: [PATCH 2/2] [config:import] Print "importing" before starting (#3083) This is more accurate than printing it after the import has finished. --- src/Command/Config/ImportCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/Config/ImportCommand.php b/src/Command/Config/ImportCommand.php index 3832469cc..20ca002c4 100644 --- a/src/Command/Config/ImportCommand.php +++ b/src/Command/Config/ImportCommand.php @@ -130,8 +130,8 @@ private function configImport(DrupalStyle $io, StorageComparer $storage_comparer $io->success($this->trans('commands.config.import.messages.already-imported')); } else { try { - $config_importer->import(); $io->info($this->trans('commands.config.import.messages.importing')); + $config_importer->import(); return TRUE; } catch (ConfigImporterException $e) { $message = 'The import failed due for the following reasons:' . "\n";