Skip to content

Commit

Permalink
fix: child process cmd: option except iterable array
Browse files Browse the repository at this point in the history
TypeError: settings.cmd is not iterable at startPhpProcess
  • Loading branch information
SRWieZ authored Nov 21, 2024
1 parent 3b3d8dc commit ededd88
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ChildProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ public function start(
?array $env = null,
bool $persistent = false
): static {
$cmd = is_array($cmd) ? array_values($cmd) : [$cmd];

$process = $this->client->post('child-process/start', [
'alias' => $alias,
'cmd' => (array) $cmd,
'cmd' => $cmd,
'cwd' => $cwd ?? base_path(),
'env' => $env,
'persistent' => $persistent,
Expand All @@ -72,9 +73,11 @@ public function start(

public function php(string|array $cmd, string $alias, ?array $env = null, ?bool $persistent = false): self
{
$cmd = is_array($cmd) ? array_values($cmd) : [$cmd];

$process = $this->client->post('child-process/start-php', [
'alias' => $alias,
'cmd' => (array) $cmd,
'cmd' => $cmd,
'cwd' => $cwd ?? base_path(),
'env' => $env,
'persistent' => $persistent,
Expand Down

0 comments on commit ededd88

Please sign in to comment.