From 7cdba04b5f2a0dd6a649d550b21215afb70ca02a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 16 May 2022 17:45:10 +0200 Subject: [PATCH] Fix #361 Rename --pretty option to --run-prettier --- src/Commands/HydeBuildStaticSiteCommand.php | 6 ++---- tests/Feature/Commands/BuildStaticSiteCommandTest.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Commands/HydeBuildStaticSiteCommand.php b/src/Commands/HydeBuildStaticSiteCommand.php index 82848e4b..b1d7db5c 100644 --- a/src/Commands/HydeBuildStaticSiteCommand.php +++ b/src/Commands/HydeBuildStaticSiteCommand.php @@ -21,8 +21,6 @@ * Hyde Command to run the Build Process. * * @see \Tests\Feature\Commands\BuildStaticSiteCommandTest - * - * @todo #361 Rename --pretty option to --run-prettier to distinguish it better */ class HydeBuildStaticSiteCommand extends Command { @@ -37,7 +35,7 @@ class HydeBuildStaticSiteCommand extends Command protected $signature = 'build {--run-dev : Run the NPM dev script after build} {--run-prod : Run the NPM prod script after build} - {--pretty : Should the build files be prettified?} + {--run-prettier : Should the build files be prettified?} {--pretty-urls : Should links in output use pretty URLs?} {--no-api : Disable external API calls, such as Torchlight}'; @@ -154,7 +152,7 @@ public function purge(): void */ public function postBuildActions(): void { - if ($this->option('pretty')) { + if ($this->option('run-prettier')) { $this->runNodeCommand( 'npx prettier '.Hyde::pathToRelative(Hyde::getSiteOutputPath($path)).'/ --write --bracket-same-line', 'Prettifying code!', diff --git a/tests/Feature/Commands/BuildStaticSiteCommandTest.php b/tests/Feature/Commands/BuildStaticSiteCommandTest.php index 566dd7fc..183d911b 100644 --- a/tests/Feature/Commands/BuildStaticSiteCommandTest.php +++ b/tests/Feature/Commands/BuildStaticSiteCommandTest.php @@ -79,7 +79,7 @@ public function test_handle_purge_method() public function test_node_action_outputs() { - $this->artisan('build --pretty --run-dev --run-prod') + $this->artisan('build --run-prettier --run-dev --run-prod') ->expectsOutput('Prettifying code! This may take a second.') ->expectsOutput('Building frontend assets for development! This may take a second.') ->expectsOutput('Building frontend assets for production! This may take a second.')