Skip to content

Commit

Permalink
fix: handle if migration folder doesn't exist in PHAR (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmouse authored Jan 9, 2025
1 parent 6718f5f commit dd5d55d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Components/Database/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Illuminate\Database\Migrations\Migrator as BaseMigrator;
use Illuminate\Support\Str;
use SplFileInfo;
use Symfony\Component\Finder\Exception\DirectoryNotFoundException;
use Symfony\Component\Finder\Finder;

use function collect;
Expand Down Expand Up @@ -43,8 +44,12 @@ function ($path) {
->files()
->name(basename($path));
} else {
$finder = (new Finder)->in([$path])
->files();
try {
$finder = (new Finder)->in([$path])
->files();
} catch (DirectoryNotFoundException $e) {
return [];
}
}

return collect($finder)
Expand Down

0 comments on commit dd5d55d

Please sign in to comment.