allow model_locations to have glob patterns (#1059)

* allow model_locations to have glob patterns

This if statement check for a valid directory was happening to early.  It was checking the string that contained the wildcards to see if it is a valid directory and always failing.  Need to check after the foreach starts. fixes #1058 .

* test(#1059) Allow glob directories

* Fix tests to chdir() into where to expect the glob to work

* Update CHANGELOG.md

Co-authored-by: Markus Podar <[email protected]>
This commit is contained in:
Isaac Earl
2020-09-20 22:06:24 +02:00
committed by GitHub
co-authored by Markus Podar
parent fd4d280a80
commit 1044f466e9
5 changed files with 227 additions and 5 deletions
+6 -5
View File
@@ -305,13 +305,14 @@ class ModelsCommand extends Command
$dir = base_path($dir);
}
if (!is_dir($dir)) {
$this->error("Cannot locate directory '{'$dir}'");
continue;
}
$dirs = glob($dir, GLOB_ONLYDIR);
foreach ($dirs as $dir) {
if (!is_dir($dir)) {
$this->error("Cannot locate directory '{'$dir}'");
continue;
}
if (file_exists($dir)) {
$classMap = ClassMapGenerator::createMap($dir);