Skip to content

Commit

Permalink
chore(shell): use exec to avoid spawning a grandchild process
Browse files Browse the repository at this point in the history
Signed-off-by: azjezz <azjezz@protonmail.com>
  • Loading branch information
azjezz committed Dec 1, 2021
1 parent d9fd48e commit 82df288
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/Psl/Shell/execute.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ static function (array $m) use (
'bypass_shell' => true,
'blocking_pipes' => false,
];
} else {
$commandline = Str\format('exec %s', $commandline);
}
// @codeCoverageIgnoreEnd
$descriptor = [
Expand Down
4 changes: 0 additions & 4 deletions tests/unit/Shell/ExecuteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ public function testCurrentEnvironmentVariablesArePassedDownToTheProcess(): void

public function testWorkingDirectoryIsUsed(): void
{
if ('Darwin' === PHP_OS_FAMILY || PHP_OS_FAMILY === 'Windows') {
static::markTestSkipped();
}

$temp = Env\temp_dir();

static::assertSame(
Expand Down

0 comments on commit 82df288

Please sign in to comment.