From 4348de742ee995eaeb60c857849782b66565b708 Mon Sep 17 00:00:00 2001 From: Adrian Chen Date: Tue, 24 Sep 2024 21:33:43 +0800 Subject: [PATCH] chore: fix regex pattern for loading files in Console.ts and Kernel.php --- src/Console.ts | 2 +- src/test/test-fixtures/app/Console/Kernel.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Console.ts b/src/Console.ts index 4ce5179..29149ff 100644 --- a/src/Console.ts +++ b/src/Console.ts @@ -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++; diff --git a/src/test/test-fixtures/app/Console/Kernel.php b/src/test/test-fixtures/app/Console/Kernel.php index 648a6a8..f43357a 100644 --- a/src/test/test-fixtures/app/Console/Kernel.php +++ b/src/test/test-fixtures/app/Console/Kernel.php @@ -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'); }