Skip to content

Commit dd5d55d

Browse files
authored
fix: handle if migration folder doesn't exist in PHAR (#456)
1 parent 6718f5f commit dd5d55d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Components/Database/Migrator.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Illuminate\Database\Migrations\Migrator as BaseMigrator;
1717
use Illuminate\Support\Str;
1818
use SplFileInfo;
19+
use Symfony\Component\Finder\Exception\DirectoryNotFoundException;
1920
use Symfony\Component\Finder\Finder;
2021

2122
use function collect;
@@ -43,8 +44,12 @@ function ($path) {
4344
->files()
4445
->name(basename($path));
4546
} else {
46-
$finder = (new Finder)->in([$path])
47-
->files();
47+
try {
48+
$finder = (new Finder)->in([$path])
49+
->files();
50+
} catch (DirectoryNotFoundException $e) {
51+
return [];
52+
}
4853
}
4954

5055
return collect($finder)

0 commit comments

Comments
 (0)