Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove v2 install option.
  • Loading branch information
jesseleite committed May 8, 2023
commit 3e28649732767342a0b0bc362bf27710e51560f1
218 changes: 0 additions & 218 deletions src/Concerns/InstallsLegacy.php

This file was deleted.

19 changes: 2 additions & 17 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

class NewCommand extends Command
{
use Concerns\RunsCommands,
Concerns\InstallsLegacy;
use Concerns\RunsCommands;

const BASE_REPO = 'statamic/statamic';
const OUTPOST_ENDPOINT = 'https://outpost.statamic.com/v3/starter-kits/';
Expand All @@ -35,7 +34,6 @@ class NewCommand extends Command
public $withConfig;
public $withoutDependencies;
public $force;
public $v2;
public $baseInstallSuccessful;
public $shouldUpdateCliToVersion = false;

Expand All @@ -56,7 +54,6 @@ protected function configure()
->addOption('local', null, InputOption::VALUE_NONE, 'Optionally install from local repo configured in composer config.json')
->addOption('with-config', null, InputOption::VALUE_NONE, 'Optionally copy starter-kit.yaml config for local development')
->addOption('without-dependencies', null, InputOption::VALUE_NONE, 'Optionally install starter kit without dependencies')
->addOption('v2', null, InputOption::VALUE_NONE, 'Create a legacy Statamic v2 application (not recommended)')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force install even if the directory already exists');
}

Expand All @@ -77,13 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
->notifyIfOldCliVersion()
->processArguments()
->validateArguments()
->showStatamicTitleArt();

if ($this->v2) {
return $this->installV2();
}

$this
->showStatamicTitleArt()
->askForRepo()
->validateStarterKitLicense()
->installBaseProject()
Expand Down Expand Up @@ -170,8 +161,6 @@ protected function processArguments()

$this->force = $this->input->getOption('force');

$this->v2 = $this->input->getOption('v2');

return $this;
}

Expand All @@ -192,10 +181,6 @@ protected function validateArguments()
throw new RuntimeException('Cannot use --force option when using current directory for installation!');
}

if ($this->starterKit && $this->v2) {
throw new RuntimeException('Cannot use starter kit with legacy v2 installation!');
}

if ($this->starterKit && $this->isInvalidStarterKit()) {
throw new RuntimeException('Please enter a valid composer package name (eg. hasselhoff/kung-fury)!');
}
Expand Down
1 change: 0 additions & 1 deletion src/Please.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class Please
{
protected $output;
protected $cwd;
protected $v2;

/**
* Instantiate Statamic `please` command wrapper.
Expand Down
4 changes: 2 additions & 2 deletions src/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$please = new Please($output);

if ($please->isV2()) {
$please->run('update');
$output->writeln(PHP_EOL.'<error>Statamic v2 is no longer supported!</error>'.PHP_EOL);

return 0;
return 1;
}

$output->writeln(PHP_EOL.'<comment>NOTE: If you have previously updated using the CP, you may need to update the version in your composer.json before running this update!</comment>'.PHP_EOL);
Expand Down
25 changes: 0 additions & 25 deletions tests/NewCommandIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,6 @@ public function it_can_scaffold_with_starter_kit_config()
$this->assertFileExists($this->appPath('starter-kit.yaml'));
}

/** @test */
public function it_can_scaffold_a_legacy_v2_statamic_app()
{
$this->assertAppNotExists();

$statusCode = $this->scaffoldNewApp(['--v2' => true]);

$this->assertSame(0, $statusCode);
$this->assertFileNotExists($this->appPath('artisan'));
$this->assertFileExists($this->appPath('please'));
$this->assertFileExists($this->appPath('local'));
$this->assertFileExists($this->appPath('site'));
$this->assertFileExists($this->appPath('statamic'));
}

/** @test */
public function it_fails_if_application_folder_already_exists()
{
Expand Down Expand Up @@ -124,16 +109,6 @@ public function it_fails_if_using_force_option_to_cwd()
$this->assertAppNotExists();
}

/** @test */
public function it_fails_if_passing_starter_kit_to_v2_installation()
{
$this->assertRuntimeException(function () {
$this->scaffoldNewApp(['starter-kit' => 'statamic/starter-kit-cool-writings', '--v2' => true]);
});

$this->assertAppNotExists();
}

/** @test */
public function it_fails_if_invalid_starter_kit_repo_is_passed()
{
Expand Down