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
8 changes: 7 additions & 1 deletion docs/1-essentials/04-console-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,13 @@ Completion relies on two things: a **completion script** sourced by your shell,

### Installing completions

Run the install command and follow the prompts:
The framework and console installers will ask whether you want to install completions:

```console
<dim>./</dim>tempest install
```

You may also run the completion command directly:

```console
<dim>./</dim>tempest completion:install
Expand Down
10 changes: 9 additions & 1 deletion packages/console/src/Installers/ConsoleInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function install(): void
{
$this->installMainNamespace();

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

$this->updateComposer();

if (! $tempest) {
return;
}

if ($this->console->confirm('Do you want to install completions?', default: false)) {
$this->console->call('completion:install');
}
}
}
10 changes: 9 additions & 1 deletion src/Tempest/Framework/Installers/FrameworkInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function install(): void
destination: root_path('public/index.php'),
);

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

$this->console->call('key:generate');

if (! $tempest) {
return;
}

if ($this->console->confirm('Do you want to install completions?', default: false)) {
$this->console->call('completion:install');
}
}
}
Loading