Skip to content

Commit 455edd5

Browse files
committed
feat(console): ask to install completions during setup
1 parent 1f144e6 commit 455edd5

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

packages/console/src/Installers/ConsoleInstaller.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function install(): void
1818
{
1919
$this->installMainNamespace();
2020

21-
$this->publish(
21+
$tempest = $this->publish(
2222
source: __DIR__ . '/tempest',
2323
destination: root_path('tempest'),
2424
callback: function (string $_, string $destination): void {
@@ -30,5 +30,13 @@ public function install(): void
3030
);
3131

3232
$this->updateComposer();
33+
34+
if (! $tempest) {
35+
return;
36+
}
37+
38+
if ($this->console->confirm('Do you want to install completions?', default: false)) {
39+
$this->console->call('completion:install');
40+
}
3341
}
3442
}

src/Tempest/Framework/Installers/FrameworkInstaller.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function install(): void
3333
destination: root_path('public/index.php'),
3434
);
3535

36-
$this->publish(
36+
$tempest = $this->publish(
3737
source: __DIR__ . '/tempest',
3838
destination: root_path('tempest'),
3939
callback: function (string $_, string $destination): void {
@@ -49,5 +49,13 @@ public function install(): void
4949
$this->console->call('discovery:generate');
5050

5151
$this->console->call('key:generate');
52+
53+
if (! $tempest) {
54+
return;
55+
}
56+
57+
if ($this->console->confirm('Do you want to install completions?', default: false)) {
58+
$this->console->call('completion:install');
59+
}
5260
}
5361
}

0 commit comments

Comments
 (0)