Skip to content

Commit

Permalink
Show specific error when missing open binary
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 28, 2023
1 parent 5e40f9b commit ae76d1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/framework/src/Console/Commands/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ protected function openInBrowser(): void
default => null
};

$process = Process::command(sprintf('%s http://%s:%d', $command, $this->getHostSelection(), $this->getPortSelection()))->run();
$process = $command ? Process::command(sprintf('%s http://%s:%d', $command, $this->getHostSelection(), $this->getPortSelection()))->run() : null;

if ($process->failed()) {
if (! $process || $process->failed()) {
$this->warn('Unable to open the site preview in the browser on your system:');
$this->line(sprintf(' %s', str_replace("\n", "\n ", $process->errorOutput())));
$this->line(sprintf(' %s', str_replace("\n", "\n ", $process ? $process->errorOutput() : "Missing suitable 'open' binary.")));
}

$this->newLine();
Expand Down

0 comments on commit ae76d1d

Please sign in to comment.