mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-22 16:27:39 +01:00
Fix ProcessRunner
This commit is contained in:
parent
b40c641ee2
commit
704af44600
@ -234,7 +234,7 @@ runLocally("echo $user");
|
||||
- **idle_timeout** `int|null` — Sets the process idle timeout (max. time since last output) in seconds.
|
||||
- **secret** `string|null` — Placeholder `%secret%` can be used in command. Placeholder will be replaced with this value and will not appear in any logs.
|
||||
- **env** `array|null` — Array of environment variables: `runLocally('echo $KEY', env: ['key' => 'value']);`
|
||||
- **shell** `string|null` — Shell to run in. Default is `bash -c`.
|
||||
- **shell** `string|null` — Shell to run in. Default is `bash -s`.
|
||||
|
||||
## test()
|
||||
|
||||
|
@ -38,7 +38,7 @@ class ProcessRunner
|
||||
'idle_timeout' => null,
|
||||
'cwd' => defined('DEPLOYER_ROOT') ? DEPLOYER_ROOT : null,
|
||||
'real_time_output' => false,
|
||||
'shell' => 'bash -c',
|
||||
'shell' => 'bash -s',
|
||||
];
|
||||
$config = array_merge($defaults, $config);
|
||||
|
||||
|
@ -401,7 +401,7 @@ function run(string $command, ?array $options = [], ?int $timeout = null, ?int $
|
||||
* @param int|null $idle_timeout Sets the process idle timeout (max. time since last output) in seconds.
|
||||
* @param string|null $secret Placeholder `%secret%` can be used in command. Placeholder will be replaced with this value and will not appear in any logs.
|
||||
* @param array|null $env Array of environment variables: `runLocally('echo $KEY', env: ['key' => 'value']);`
|
||||
* @param string|null $shell Shell to run in. Default is `bash -c`.
|
||||
* @param string|null $shell Shell to run in. Default is `bash -s`.
|
||||
*
|
||||
* @throws RunException
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@ namespace Deployer;
|
||||
require_once __DIR__ . '/hosts.php';
|
||||
|
||||
task('test:misc:sudo-write-user', function (): void {
|
||||
$cmd = 'sudo bash -c \'echo Current user is: $USER\'';
|
||||
$cmd = 'sudo bash -s \'echo Current user is: $USER\'';
|
||||
$output = run($cmd);
|
||||
writeln($output);
|
||||
})->shallow();
|
||||
|
Loading…
x
Reference in New Issue
Block a user