Filters for JSON files, closes #8

This commit is contained in:
distinctm
2019-06-12 17:52:32 -04:00
parent 58f1062aeb
commit e7608ca9d6
3 changed files with 24 additions and 3 deletions

View File

@@ -106,9 +106,12 @@ class Updater
return Collection::wrap($directory . '/' . $model . '.json');
}
return collect(File::files($directory))->map(function ($path) {
return $path->getPathname();
});
return collect(File::files($directory))
->filter(function($file) {
return pathinfo($file, PATHINFO_EXTENSION) == 'json';
})->map(function ($path) {
return $path->getPathname();
});
}
/**