Skip to content

Commit

Permalink
Extract state helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 9, 2023
1 parent a7ccda2 commit c4b8cae
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/framework/src/Console/Commands/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ protected function getExecutablePath(): string

protected function runServerProcess(string $command): void
{
$outputHandler = $this->option('no-ansi') ? $this->getDefaultOutputHandler() : $this->getFancyOutputHandler();
$outputHandler = $this->useBasicOutput() ? $this->getDefaultOutputHandler() : $this->getFancyOutputHandler();

Process::forever()->run($command, $outputHandler);
}

protected function printStartMessage(): void
{
if ($this->option('no-ansi')) {
if ($this->useBasicOutput()) {
$this->line('<info>Starting the HydeRC server...</info> Press Ctrl+C to stop');
} else {
$title = 'HydePHP Realtime Compiler';
Expand Down Expand Up @@ -176,4 +176,9 @@ protected function getFancyOutputHandler(): Closure
$this->handleOutput($line);
};
}

protected function useBasicOutput(): bool
{
return $this->option('no-ansi');
}
}

0 comments on commit c4b8cae

Please sign in to comment.