Skip to content

Commit e02e6da

Browse files
committed
fix: move Laravel Boost installation before --remove-me option
This fixes a critical bug where Laravel Boost was being installed AFTER the --remove-me block, making it impossible to install Laravel Boost when using the --remove-me option. Changes: - Moved Laravel Boost installation before the --remove-me conditional block - Updated related tests to include proper File mock setup - All tests passing (29 passed) Fixes the installation order to ensure Laravel Boost is always installed regardless of whether --remove-me is used.
1 parent 9a89c99 commit e02e6da

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

src/Commands/InstallCommand.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,20 @@ public function handle(): int
129129

130130
$this->info('✅ Rector installed successfully');
131131

132+
// - install laravel boost via composer using Processees
133+
spin(
134+
callback: function (): void {
135+
136+
$process = Process::run('composer require laravel/boost --dev -n');
137+
if ($process->failed()) {
138+
self::fail('❌ Failed to install laravel boost');
139+
}
140+
},
141+
message: 'Installing laravel boost...'
142+
);
143+
144+
$this->info('✅ Laravel Boost installed successfully');
145+
132146
if ($this->option('remove-me')) {
133147
spin(
134148
callback: function (): void {
@@ -151,20 +165,6 @@ public function handle(): int
151165

152166
}
153167

154-
// - install laravel boost via composer using Processees
155-
spin(
156-
callback: function (): void {
157-
158-
$process = Process::run('composer require laravel/boost --dev -n');
159-
if ($process->failed()) {
160-
self::fail('❌ Failed to install laravel boost');
161-
}
162-
},
163-
message: 'Installing laravel boost...'
164-
);
165-
166-
$this->info('✅ Laravel Boost installed successfully');
167-
168168
// running composer update
169169
spin(
170170
callback: function (): void {

tests/Feature/InstallCommandTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,10 @@
420420
});
421421

422422
it('installs laravel boost with the right command', function (): void {
423+
// Arrange
424+
File::shouldReceive('copy')
425+
->andReturn(true);
426+
423427
Process::fake([
424428
'composer require laravel/boost --dev -n' => Process::result(
425429
exitCode: 0
@@ -438,6 +442,9 @@
438442

439443
it('fails if cannot install laravel boost', function (): void {
440444
// Arrange
445+
File::shouldReceive('copy')
446+
->andReturn(true);
447+
441448
Process::fake([
442449
'composer require laravel/boost --dev -n' => Process::result(
443450
exitCode: 1

0 commit comments

Comments
 (0)