Skip to content

Commit

Permalink
Fix #361 Rename --pretty option to --run-prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed May 16, 2022
1 parent 1d92b74 commit 7cdba04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/Commands/HydeBuildStaticSiteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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}';

Expand Down Expand Up @@ -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!',
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Commands/BuildStaticSiteCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down

0 comments on commit 7cdba04

Please sign in to comment.