Skip to content

Commit

Permalink
Merge pull request #7 from LarsWiegers/fix_deeper_directories_bug
Browse files Browse the repository at this point in the history
fix bug with deeper directories
  • Loading branch information
LarsWiegers committed Mar 14, 2022
2 parents 8265713 + 1299d57 commit 00d2655
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Console/Commands/CheckIfTranslationsAreAllThereCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 00d2655

Please sign in to comment.