From 1eae83473dc7b6071bd89b6a3d4d0dfd88bad422 Mon Sep 17 00:00:00 2001 From: neznaika0 Date: Sat, 11 Jan 2025 12:56:54 +0300 Subject: [PATCH] refactor: Accurate command finishing --- system/Commands/Translation/LocalizationSync.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/system/Commands/Translation/LocalizationSync.php b/system/Commands/Translation/LocalizationSync.php index 0ba7a023b61c..b2614ab3ca2e 100644 --- a/system/Commands/Translation/LocalizationSync.php +++ b/system/Commands/Translation/LocalizationSync.php @@ -89,10 +89,12 @@ public function run(array $params) $this->languagePath = SUPPORTPATH . 'Language'; } - if ($this->process($optionLocale, $optionTargetLocale) === EXIT_SUCCESS) { - CLI::write('All operations done!'); + if ($this->process($optionLocale, $optionTargetLocale) === EXIT_ERROR) { + return EXIT_ERROR; } + CLI::write('All operations done!'); + return EXIT_SUCCESS; } @@ -130,7 +132,7 @@ private function process(string $originalLocale, string $targetLocale): int ); /** - * @var list $files + * @var array $files */ $files = iterator_to_array($iterator, true); ksort($files);