Skip to content

Commit

Permalink
Update NewCommand.php
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell authored May 31, 2024
1 parent 466a710 commit 66de8fb
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -788,30 +788,6 @@ protected function isParked(string $directory)
return $output !== false ? in_array(dirname($directory), json_decode($output)) : false;
}

/**
* Runs the given command on "herd" or "valet" cli.
*
* @param string $command
* @return string|bool
*/
protected function runOnValetOrHerd(string $command)
{
foreach (['herd', 'valet'] as $tool) {
$process = new Process([$tool, $command, '-v']);

try {
$process->run();

if ($process->isSuccessful()) {
return trim($process->getOutput());
}
} catch (ProcessStartFailedException) {
}
}

return false;
}

/**
* Get the version that should be downloaded.
*
Expand Down Expand Up @@ -851,6 +827,30 @@ protected function phpBinary()
: 'php';
}

/**
* Runs the given command on the "herd" or "valet" CLI.
*
* @param string $command
* @return string|bool
*/
protected function runOnValetOrHerd(string $command)
{
foreach (['herd', 'valet'] as $tool) {
$process = new Process([$tool, $command, '-v']);

try {
$process->run();

if ($process->isSuccessful()) {
return trim($process->getOutput());
}
} catch (ProcessStartFailedException) {
}
}

return false;
}

/**
* Run the given commands.
*
Expand Down

0 comments on commit 66de8fb

Please sign in to comment.