Skip to content

Commit

Permalink
fix: Shell object is not an array
Browse files Browse the repository at this point in the history
  • Loading branch information
hussainweb committed Feb 3, 2022
1 parent e9d0f02 commit cc07d0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/Transport/CustomTransport.php
Expand Up @@ -35,13 +35,14 @@ public function configure(SiteProcess $process)
*/
public function wrap($args)
{
$transport = Shell::preEscaped($this->siteAlias->get('custom.command', ''));
$cmd = $this->siteAlias->get('custom.command', '');
$transport = $cmd ? [Shell::preEscaped($cmd)] : [];
$commandToExecute = $this->getCommandToExecute($args);

return array_merge(
return array_filter(array_merge(
$transport,
$commandToExecute
);
));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Transport/CustomTransportTest.php
Expand Up @@ -47,8 +47,8 @@ public function wrapTestValues()
public function testWrap($expected, $siteAliasData)
{
$siteAlias = new SiteAlias($siteAliasData, '@alias.dev');
$dockerTransport = new CustomTransport($siteAlias);
$actual = $dockerTransport->wrap(['ls']);
$customTransport = new CustomTransport($siteAlias);
$actual = $customTransport->wrap(['ls']);
$this->assertEquals($expected, implode(' ', $actual));
}
}

0 comments on commit cc07d0f

Please sign in to comment.