Skip to content

Commit

Permalink
fix array options
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed May 1, 2020
1 parent 7f00dbb commit cfc3ac9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Illuminate/Console/Scheduling/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\CallQueuedClosure;
use Illuminate\Support\ProcessUtils;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use RuntimeException;

Expand Down Expand Up @@ -198,7 +199,11 @@ public function exec($command, array $parameters = [])
protected function compileParameters(array $parameters)
{
return collect($parameters)->map(function ($value, $key) {
if (is_array($value)) {
if (is_array($value) && Str::startsWith($key, '--')) {
return collect($value)->map(function ($value) use ($key) {
return $key.'='.ProcessUtils::escapeArgument($value);
})->implode(' ');
} elseif (is_array($value)) {
$value = collect($value)->map(function ($value) {
return ProcessUtils::escapeArgument($value);
})->implode(' ');
Expand Down

0 comments on commit cfc3ac9

Please sign in to comment.