Skip to content

Commit

Permalink
Use builtin no-interaction option instead of custom parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Aug 18, 2023
1 parent 48b309c commit d7d5e67
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ jobs:
- name: Setup indices
run: |
php artisan es:create-search-blacklist
php artisan es:index-documents --yes
php artisan es:index-wiki --create-only --yes
php artisan es:index-documents --no-interaction
php artisan es:index-wiki --create-only --no-interaction
- name: Generate docs
run: php artisan scribe:generate
Expand All @@ -158,7 +158,7 @@ jobs:
# but has since been fixed.
# Something should still be done regarding es index between tests though.
- name: Clean indexes
run: php artisan es:index-documents --yes
run: php artisan es:index-documents --no-interaction

- name: Run Dusk
run: ./bin/run_dusk.sh
Expand Down
4 changes: 2 additions & 2 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ Once the env files are set, database for testing will need to be setup:
Tests should be run against an empty database, to initialize an empty database:

```
APP_ENV=testing php artisan migrate:fresh --yes
APP_ENV=testing php artisan migrate:fresh --no-interaction
```

or if using docker:

```
docker compose run --rm -e APP_ENV=testing php artisan migrate:fresh --yes
docker compose run --rm -e APP_ENV=testing php artisan migrate:fresh --no-interaction
```

---
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/BeatmapLeadersRefresh.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BeatmapLeadersRefresh extends Command
*/
public function handle()
{
$continue = $this->option('yes') || $this->confirm('This will recalculate beatmap leaders, continue?');
$continue = $this->option('yes') || $this->confirm('This will recalculate beatmap leaders, continue?', true);

if (!$continue) {
return $this->error('User aborted!');
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/EsIndexDocuments.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,6 @@ protected function starterMessage(array $oldIndices)
$confirmMessage = 'This will create new indices';
}

return $this->yes || $this->confirm("{$confirmMessage}, begin indexing?");
return $this->yes || $this->confirm("{$confirmMessage}, begin indexing?", true);
}
}
2 changes: 1 addition & 1 deletion app/Console/Commands/EsIndexWiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private function starterMessage()
);
}

return $this->yes || $this->confirm("This index to {$this->indexName}, begin indexing?");
return $this->yes || $this->confirm("This index to {$this->indexName}, begin indexing?", true);
}

private function updateSitemap()
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/ForumTopicCoversCleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function handle()
$createdBefore = now()->subDays(get_int($this->option('maxdays')) ?? 30);
$this->line("This will delete unused topic covers before {$createdBefore}.");

if (!$this->option('yes') && !$this->confirm('Proceed?')) {
if (!$this->option('yes') && !$this->confirm('Proceed?', true)) {
$this->error('Aborted.');
return;
}
Expand Down
6 changes: 3 additions & 3 deletions app/Console/Commands/MigrateFreshAllCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function handle()
$this->warn("{$name} => {$config['database']}");
}

$continue = $this->option('yes') || $this->confirm('continue?');
$continue = $this->option('yes') || $this->confirm('continue?', true);
if (!$continue) {
$this->error('User aborted!');
return 1;
Expand All @@ -47,13 +47,13 @@ public function handle()

$this->call('es:index-documents', [
'--cleanup' => true,
'--yes' => $this->option('yes'),
'--no-interaction' => $this->option('no-interaction'),
]);

$this->call('es:index-wiki', [
'--cleanup' => true,
'--create-only' => true,
'--yes' => $this->option('yes'),
'--no-interaction' => $this->option('no-interaction'),
]);

$this->call('es:create-search-blacklist');
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/MigrateFreshOrRunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function handle()
private function fresh()
{
$this->info('Database is empty. Calling migrate:fresh to initalise database and elasticsearch.');
$this->call('migrate:fresh', ['--yes' => true]);
$this->call('migrate:fresh', ['--no-interaction' => true]);
}

private function migrate()
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function schedule(Schedule $schedule)
->everyThirtyMinutes()
->onOneServer();

$schedule->command('forum:topic-cover-cleanup --yes')
$schedule->command('forum:topic-cover-cleanup --no-interaction')
->daily()
->withoutOverlapping()
->onOneServer();
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/InterOp/ArtistTracksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function reindexAll()
'--cleanup' => $params['cleanup'] ?? true,
'--inplace' => $params['inplace'] ?? true,
'--types' => 'artist_tracks',
'--yes' => true,
'--no-interaction' => true,
]);

return response()->noContent();
Expand Down

0 comments on commit d7d5e67

Please sign in to comment.