From 1299d57bc7d791fbe2038a0ed0d45ab8591681a3 Mon Sep 17 00:00:00 2001 From: Lars Wiegers Date: Mon, 14 Mar 2022 20:14:48 +0100 Subject: [PATCH] fix bug with deeper directories --- .../CheckIfTranslationsAreAllThereCommand.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Console/Commands/CheckIfTranslationsAreAllThereCommand.php b/src/Console/Commands/CheckIfTranslationsAreAllThereCommand.php index 9b70a79..1bded09 100644 --- a/src/Console/Commands/CheckIfTranslationsAreAllThereCommand.php +++ b/src/Console/Commands/CheckIfTranslationsAreAllThereCommand.php @@ -79,6 +79,10 @@ public function handle() $languagesWithMissingFile = $this->checkIfFileExistsForOtherLanguages($languages, $fileName, $directory); + if ($this->isDirInExcludedDirectories($languageDir)) { + continue; + } + foreach ($languagesWithMissingFile as $languageWithMissingFile) { if ($this->isDirInExcludedDirectories($languageWithMissingFile)) { continue; @@ -199,6 +203,12 @@ private function checkIfFileExistsForOtherLanguages($languages, $fileName, $base private function isDirInExcludedDirectories($directoryToCheck): bool { - return in_array($directoryToCheck, $this->excludedDirectories, true); + foreach($this->excludedDirectories as $excludedDirectory) { + if(Str::contains($directoryToCheck, $excludedDirectory)) { + return true; + } + } + + return false; } }