Skip to content

Commit 15af33a

Browse files
authored
Merge pull request #57 from statamic/remove-v2-install-option
2 parents d51b006 + 3e28649 commit 15af33a

File tree

5 files changed

+4
-263
lines changed

5 files changed

+4
-263
lines changed

src/Concerns/InstallsLegacy.php

Lines changed: 0 additions & 218 deletions
This file was deleted.

src/NewCommand.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
class NewCommand extends Command
1818
{
19-
use Concerns\RunsCommands,
20-
Concerns\InstallsLegacy;
19+
use Concerns\RunsCommands;
2120

2221
const BASE_REPO = 'statamic/statamic';
2322
const OUTPOST_ENDPOINT = 'https://outpost.statamic.com/v3/starter-kits/';
@@ -35,7 +34,6 @@ class NewCommand extends Command
3534
public $withConfig;
3635
public $withoutDependencies;
3736
public $force;
38-
public $v2;
3937
public $baseInstallSuccessful;
4038
public $shouldUpdateCliToVersion = false;
4139

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

@@ -77,13 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7774
->notifyIfOldCliVersion()
7875
->processArguments()
7976
->validateArguments()
80-
->showStatamicTitleArt();
81-
82-
if ($this->v2) {
83-
return $this->installV2();
84-
}
85-
86-
$this
77+
->showStatamicTitleArt()
8778
->askForRepo()
8879
->validateStarterKitLicense()
8980
->installBaseProject()
@@ -170,8 +161,6 @@ protected function processArguments()
170161

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

173-
$this->v2 = $this->input->getOption('v2');
174-
175164
return $this;
176165
}
177166

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

195-
if ($this->starterKit && $this->v2) {
196-
throw new RuntimeException('Cannot use starter kit with legacy v2 installation!');
197-
}
198-
199184
if ($this->starterKit && $this->isInvalidStarterKit()) {
200185
throw new RuntimeException('Please enter a valid composer package name (eg. hasselhoff/kung-fury)!');
201186
}

src/Please.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class Please
1010
{
1111
protected $output;
1212
protected $cwd;
13-
protected $v2;
1413

1514
/**
1615
* Instantiate Statamic `please` command wrapper.

src/UpdateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
4242
$please = new Please($output);
4343

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

47-
return 0;
47+
return 1;
4848
}
4949

5050
$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);

tests/NewCommandIntegrationTest.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,6 @@ public function it_can_scaffold_with_starter_kit_config()
6969
$this->assertFileExists($this->appPath('starter-kit.yaml'));
7070
}
7171

72-
/** @test */
73-
public function it_can_scaffold_a_legacy_v2_statamic_app()
74-
{
75-
$this->assertAppNotExists();
76-
77-
$statusCode = $this->scaffoldNewApp(['--v2' => true]);
78-
79-
$this->assertSame(0, $statusCode);
80-
$this->assertFileNotExists($this->appPath('artisan'));
81-
$this->assertFileExists($this->appPath('please'));
82-
$this->assertFileExists($this->appPath('local'));
83-
$this->assertFileExists($this->appPath('site'));
84-
$this->assertFileExists($this->appPath('statamic'));
85-
}
86-
8772
/** @test */
8873
public function it_fails_if_application_folder_already_exists()
8974
{
@@ -124,16 +109,6 @@ public function it_fails_if_using_force_option_to_cwd()
124109
$this->assertAppNotExists();
125110
}
126111

127-
/** @test */
128-
public function it_fails_if_passing_starter_kit_to_v2_installation()
129-
{
130-
$this->assertRuntimeException(function () {
131-
$this->scaffoldNewApp(['starter-kit' => 'statamic/starter-kit-cool-writings', '--v2' => true]);
132-
});
133-
134-
$this->assertAppNotExists();
135-
}
136-
137112
/** @test */
138113
public function it_fails_if_invalid_starter_kit_repo_is_passed()
139114
{

0 commit comments

Comments
 (0)