From d7d5e67d988cfa41140f78cfd2111cb2fc501396 Mon Sep 17 00:00:00 2001 From: nanaya Date: Fri, 18 Aug 2023 16:24:53 +0900 Subject: [PATCH] Use builtin no-interaction option instead of custom parameter --- .github/workflows/tests.yml | 6 +++--- SETUP.md | 4 ++-- app/Console/Commands/BeatmapLeadersRefresh.php | 2 +- app/Console/Commands/EsIndexDocuments.php | 2 +- app/Console/Commands/EsIndexWiki.php | 2 +- app/Console/Commands/ForumTopicCoversCleanup.php | 2 +- app/Console/Commands/MigrateFreshAllCommand.php | 6 +++--- app/Console/Commands/MigrateFreshOrRunCommand.php | 2 +- app/Console/Kernel.php | 2 +- app/Http/Controllers/InterOp/ArtistTracksController.php | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a1202ab1847..cf7bb44e3bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 diff --git a/SETUP.md b/SETUP.md index e298f0750ac..646c344ef85 100644 --- a/SETUP.md +++ b/SETUP.md @@ -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 ``` --- diff --git a/app/Console/Commands/BeatmapLeadersRefresh.php b/app/Console/Commands/BeatmapLeadersRefresh.php index 5a92e98d477..ef613b98671 100644 --- a/app/Console/Commands/BeatmapLeadersRefresh.php +++ b/app/Console/Commands/BeatmapLeadersRefresh.php @@ -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!'); diff --git a/app/Console/Commands/EsIndexDocuments.php b/app/Console/Commands/EsIndexDocuments.php index f89990fb07c..9e368d26357 100644 --- a/app/Console/Commands/EsIndexDocuments.php +++ b/app/Console/Commands/EsIndexDocuments.php @@ -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); } } diff --git a/app/Console/Commands/EsIndexWiki.php b/app/Console/Commands/EsIndexWiki.php index 3d70d1ff913..b502cff0709 100644 --- a/app/Console/Commands/EsIndexWiki.php +++ b/app/Console/Commands/EsIndexWiki.php @@ -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() diff --git a/app/Console/Commands/ForumTopicCoversCleanup.php b/app/Console/Commands/ForumTopicCoversCleanup.php index 1e11f192b33..2ed291a66b6 100644 --- a/app/Console/Commands/ForumTopicCoversCleanup.php +++ b/app/Console/Commands/ForumTopicCoversCleanup.php @@ -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; } diff --git a/app/Console/Commands/MigrateFreshAllCommand.php b/app/Console/Commands/MigrateFreshAllCommand.php index 478a884a598..510e502cf87 100644 --- a/app/Console/Commands/MigrateFreshAllCommand.php +++ b/app/Console/Commands/MigrateFreshAllCommand.php @@ -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; @@ -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'); diff --git a/app/Console/Commands/MigrateFreshOrRunCommand.php b/app/Console/Commands/MigrateFreshOrRunCommand.php index b0723c638c6..0f5b64efd65 100644 --- a/app/Console/Commands/MigrateFreshOrRunCommand.php +++ b/app/Console/Commands/MigrateFreshOrRunCommand.php @@ -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() diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a3895057ce5..511aa68489d 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -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(); diff --git a/app/Http/Controllers/InterOp/ArtistTracksController.php b/app/Http/Controllers/InterOp/ArtistTracksController.php index dd87dac807b..7fe47736a55 100644 --- a/app/Http/Controllers/InterOp/ArtistTracksController.php +++ b/app/Http/Controllers/InterOp/ArtistTracksController.php @@ -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();