Skip to content

Commit 26bb5bd

Browse files
committed
[#1639] Added AI agentic instructions selection to the installer and improved TUI.
1 parent c8f94bc commit 26bb5bd

26 files changed

Lines changed: 3259 additions & 625 deletions

File tree

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
/.gitattributes export-ignore
77
/.github/FUNDING.yml export-ignore
8-
/.vortex export-ignore
8+
/.vortex export-ignore

.vortex/installer/src/Command/InstallCommand.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ protected function handleDemo(): array|string {
350350

351351
protected function header(): void {
352352
$logo = <<<EOT
353-
-------------------------------------------------------------------------------
353+
────────────────────────────────────────────────────────────────────────────────
354354
355355
██╗ ██╗ ██████╗ ██████╗ ████████╗ ███████╗ ██╗ ██╗
356356
██║ ██║ ██╔═══██╗ ██╔══██╗ ╚══██╔══╝ ██╔════╝ ╚██╗██╔╝
@@ -362,7 +362,7 @@ protected function header(): void {
362362
Drupal project template
363363
364364
by DrevOps
365-
-------------------------------------------------------------------------------
365+
────────────────────────────────────────────────────────────────────────────────
366366
EOT;
367367

368368
// Print the logo only if the terminal is wide enough.
@@ -375,13 +375,13 @@ protected function header(): void {
375375

376376
$ref = $this->config->get(Config::REF);
377377
if ($ref == Downloader::REF_STABLE) {
378-
$content .= 'This will install the latest version of Vortex into your project.' . PHP_EOL;
378+
$content .= 'This tool will guide you through installing the latest version of Vortex into your project.' . PHP_EOL;
379379
}
380380
elseif ($ref == Downloader::REF_HEAD) {
381-
$content .= 'This will install the latest development version of Vortex into your project.' . PHP_EOL;
381+
$content .= 'This tool will guide you through installing the latest development version of Vortex into your project.' . PHP_EOL;
382382
}
383383
else {
384-
$content .= sprintf('This will install Vortex into your project at commit "%s".', $ref) . PHP_EOL;
384+
$content .= sprintf('This tool will guide you through installing the version of Vortex into your project at commit "%s".', $ref) . PHP_EOL;
385385
}
386386

387387
$content .= PHP_EOL;
@@ -399,12 +399,13 @@ protected function header(): void {
399399
$title = 'Welcome to Vortex non-interactive installer';
400400
}
401401
else {
402-
$content .= 'Please answer the questions below to install configuration relevant to your site.' . PHP_EOL;
403-
$content .= 'No changes will be applied until the last confirmation step.' . PHP_EOL;
402+
$content .= 'You’ll be asked a few questions to tailor the configuration to your site.' . PHP_EOL;
403+
$content .= 'No changes will be made until you confirm everything at the end.' . PHP_EOL;
404404
$content .= PHP_EOL;
405-
$content .= 'Existing committed files may be modified. You will need to resolve any changes manually.' . PHP_EOL;
405+
$content .= 'If you proceed, some committed files may be modified after confirmation, and you may need to resolve any changes manually.' . PHP_EOL;
406406
$content .= PHP_EOL;
407-
$content .= 'Press Ctrl+C at any time to exit this installer.' . PHP_EOL;
407+
$content .= 'Press Ctrl+C at any time to exit the installer.' . PHP_EOL;
408+
$content .= 'Press Ctrl+U at any time to go back to the previous step.' . PHP_EOL;
408409
}
409410

410411
Tui::box($content, $title);
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DrevOps\VortexInstaller\Prompts\Handlers;
6+
7+
class AiCodeInstructions extends AbstractHandler {
8+
9+
const NONE = 'none';
10+
11+
const CLAUDE = 'claude';
12+
13+
/**
14+
* {@inheritdoc}
15+
*/
16+
public function discover(): null|string|bool|array {
17+
if (!$this->isInstalled()) {
18+
return NULL;
19+
}
20+
21+
if (is_readable($this->dstDir . '/CLAUDE.md')) {
22+
return self::CLAUDE;
23+
}
24+
25+
return self::NONE;
26+
}
27+
28+
/**
29+
* {@inheritdoc}
30+
*/
31+
public function process(): void {
32+
$v = $this->getResponseAsString();
33+
$t = $this->tmpDir;
34+
35+
if ($v !== self::CLAUDE) {
36+
@unlink($t . '/CLAUDE.md');
37+
}
38+
}
39+
40+
}

0 commit comments

Comments
 (0)