fix: processWithEnv()->run

This commit is contained in:
Andras Bacsai
2023-09-14 10:26:48 +02:00
parent 17c0e91a0d
commit 046eab3776

View File

@@ -54,7 +54,7 @@ function removePrivateKeyFromSshAgent(Server $server)
if (data_get($server, 'privateKey.private_key') === null) { if (data_get($server, 'privateKey.private_key') === null) {
throw new \Exception("Server {$server->name} does not have a private key"); throw new \Exception("Server {$server->name} does not have a private key");
} }
Process::run("echo '{$server->privateKey->private_key}' | ssh-add -d -"); processWithEnv()->run("echo '{$server->privateKey->private_key}' | ssh-add -d -");
} }
function addPrivateKeyToSshAgent(Server $server, bool $onlyRemove = false) function addPrivateKeyToSshAgent(Server $server, bool $onlyRemove = false)
{ {
@@ -62,7 +62,7 @@ function addPrivateKeyToSshAgent(Server $server, bool $onlyRemove = false)
throw new \Exception("Server {$server->name} does not have a private key"); throw new \Exception("Server {$server->name} does not have a private key");
} }
// ray('adding key', $server->privateKey->private_key); // ray('adding key', $server->privateKey->private_key);
Process::run("echo '{$server->privateKey->private_key}' | ssh-add -q -"); processWithEnv()->run("echo '{$server->privateKey->private_key}' | ssh-add -q -");
} }
function generateSshCommand(string $server_ip, string $user, string $port, string $command, bool $isMux = true) function generateSshCommand(string $server_ip, string $user, string $port, string $command, bool $isMux = true)