Skip to content

Commit

Permalink
Fixes the issue of running docs command on windows (#43566)
Browse files Browse the repository at this point in the history
* Fixes the issue of running `docs` command on windows

* Update DocsCommand.php

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
mahmoudmohamedramadan and taylorotwell committed Aug 5, 2022
1 parent bb91bf7 commit e682c7a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Illuminate/Foundation/Console/DocsCommand.php
Expand Up @@ -400,7 +400,13 @@ protected function openViaBuiltInStrategy($url)
return;
}

$process = tap(Process::fromShellCommandline($binary.' '.escapeshellarg($url)))->run();
$binaryExecutable = [
'Darwin' => 'open',
'Windows' => 'start',
'Linux' => 'xdg-open'
][$this->systemOsFamily];

$process = tap(Process::fromShellCommandline($binaryExecutable.' '.escapeshellcmd($url)))->run();

if (! $process->isSuccessful()) {
throw new ProcessFailedException($process);
Expand Down

0 comments on commit e682c7a

Please sign in to comment.