fix: never use a shell

This commit is contained in:
2025-08-17 18:45:40 +02:00
parent 25e4c6a151
commit ad740afb5f
4 changed files with 61 additions and 45 deletions

View File

@@ -8,17 +8,6 @@ $output = (new Command('echo'))
->arg('Hello, World!')
->output();
var_dump($output);
echo $output->stdout;
// object(Nih\CommandBuilder\Output)#9 (3) {
// ["stdout"]=>
// string(14) "Hello, World!
// "
// ["stderr"]=>
// string(0) ""
// ["code"]=>
// object(Nih\CommandBuilder\ExitStatus)#8 (1) {
// ["code"]=>
// int(0)
// }
// }
// Hello, World!

View File

@@ -10,8 +10,8 @@ $echo = (new Command('echo'))
->stdout(Stdio::piped())
->spawn();
$cat = (new Command('cat'))
(new Command('cat'))
->stdin(Stdio::stream($echo->stdout))
->status();
// Prints "Hello, World!\n"
// Hello, World!