Skip to content

Commit

Permalink
Merge pull request #43 from absszero/fix/console-ref
Browse files Browse the repository at this point in the history
chore: fix regex pattern for loading files in Console.ts and Kernel.php
  • Loading branch information
absszero authored Sep 24, 2024
2 parents 6243978 + 4348de7 commit e26eb9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class Console {
return files;
}

const pattern = /\$this->load\(\s*__DIR__\.['"]([^'"]+)/g;
const pattern = /\$this->load\(\s*__DIR__\s*\.\s*['"]([^'"]+)/g;
while ((match = pattern.exec(match[1])) !== null) {
if (match.index === pattern.lastIndex) {
pattern.lastIndex++;
Expand Down
2 changes: 1 addition & 1 deletion src/test/test-fixtures/app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function schedule(Schedule $schedule): void
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
$this->load(__DIR__ . '/Commands');

require base_path('routes/console.php');
}
Expand Down

0 comments on commit e26eb9b

Please sign in to comment.