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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user