Skip to content

Commit 6e29dbf

Browse files
committed
refactor: simplify artisan path resolution by removing fallback
1 parent 2bc02f8 commit 6e29dbf

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Install/CodeEnvironment/CodeEnvironment.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Laravel\Boost\Install\Detection\DetectionStrategyFactory;
1313
use Laravel\Boost\Install\Enums\McpInstallationStrategy;
1414
use Laravel\Boost\Install\Enums\Platform;
15+
use Throwable;
1516

1617
abstract class CodeEnvironment
1718
{
@@ -51,12 +52,8 @@ public function getArtisanPath(): string
5152
return './artisan';
5253
}
5354

54-
// Try to get the base path from Laravel app, fallback to getcwd
55-
try {
56-
return base_path('artisan');
57-
} catch (\Throwable) {
58-
return getcwd().'/artisan';
59-
}
55+
return base_path('artisan');
56+
6057
}
6158

6259
/**

0 commit comments

Comments
 (0)