1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 08:40:09 +01:00

Ensure commands starting with "sudo" are run normally

This commit is contained in:
Aryeh Raber
2020-04-26 13:41:12 +02:00
parent 86fa649362
commit dedaddeff0

View File

@@ -66,7 +66,7 @@ function run($print, $plainText)
$results = collect($this->commands)->map(function ($command) {
$this->beforeCommand($command);
$output = $this->cli->runAsUser($command);
$output = $this->runCommand($command);
$this->afterCommand($command, $output);
@@ -104,6 +104,13 @@ function afterRun()
output('');
}
function runCommand($command)
{
return strpos($command, 'sudo ') === 0
? $this->cli->run($command)
: $this->cli->runAsUser($command);
}
function beforeCommand($command)
{
if ($this->print) {