Skip to content

Commit a7287a7

Browse files
committed
refactor: remove --remove-me option
The --remove-me option is removed as it's considered unnecessary. Users who want to remove the package can simply run: composer remove dev-to-geek/laravel-init This simplifies the codebase and reduces complexity. Changes: - Removed --remove-me option from command signature - Removed conditional block that handled package self-removal - Removed related tests (2 tests) - All remaining tests passing (27 passed, 62 assertions) This is a cleaner approach that follows the principle of doing one thing well.
1 parent e02e6da commit a7287a7

2 files changed

Lines changed: 1 addition & 48 deletions

File tree

src/Commands/InstallCommand.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class InstallCommand extends Command
1414
{
15-
public $signature = 'laravel-init:install {--remove-me : Remove the laravel-init package after installation}';
15+
public $signature = 'laravel-init:install';
1616

1717
public $description = 'Install Pint, PhpStan, Pest, Pail.';
1818

@@ -143,28 +143,6 @@ public function handle(): int
143143

144144
$this->info('✅ Laravel Boost installed successfully');
145145

146-
if ($this->option('remove-me')) {
147-
spin(
148-
callback: function (): void {
149-
$process = Process::run('composer remove dev-to-geek/laravel-init -n');
150-
if ($process->failed()) {
151-
self::fail('❌ Failed to remove laravel-init');
152-
}
153-
154-
$process = Process::run('composer install -n');
155-
if ($process->failed()) {
156-
self::fail('❌ Failed to execute composer install');
157-
}
158-
159-
},
160-
message: 'Removing laravel-init...'
161-
);
162-
163-
$this->info('So long, and thanks for all the fish!');
164-
$this->info('✅ laravel-init removed successfully');
165-
166-
}
167-
168146
// running composer update
169147
spin(
170148
callback: function (): void {

tests/Feature/InstallCommandTest.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -460,31 +460,6 @@
460460
->assertExitCode(1);
461461
});
462462

463-
it('accepts remove-me option', function (): void {
464-
// Arrange
465-
File::shouldReceive('copy')
466-
->andReturn(true);
467-
Process::fake();
468-
469-
// Act
470-
$this->artisan('laravel-init:install --remove-me')
471-
->assertExitCode(0);
472-
});
473-
474-
it('removes itself from composer if option remove-me is true', function (): void {
475-
// Arrange
476-
File::shouldReceive('copy')
477-
->andReturn(true);
478-
Process::fake();
479-
480-
// Act
481-
$this->artisan('laravel-init:install --remove-me');
482-
483-
// Assert
484-
Process::assertRan('composer remove dev-to-geek/laravel-init -n');
485-
486-
});
487-
488463
it('runs composer update command', function (): void {
489464
// Arrange
490465
File::shouldReceive('copy')

0 commit comments

Comments
 (0)