mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Return $result if getStdError() returns an empty string.
This is done to support applications which return a non-zero exit status but do not output error messages to stderr.
This commit is contained in:
parent
bb330efba0
commit
b45e2dc0f9
@ -74,12 +74,12 @@ class PhpSecLib implements ServerInterface
|
||||
break;
|
||||
|
||||
case Configuration::AUTH_BY_AGENT:
|
||||
|
||||
|
||||
$key = new Agent();
|
||||
$result = $this->sftp->login($serverConfig->getUser(), $key);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
throw new RuntimeException('You need to specify authentication method.');
|
||||
}
|
||||
@ -109,7 +109,8 @@ class PhpSecLib implements ServerInterface
|
||||
$result = $this->sftp->exec($command);
|
||||
|
||||
if ($this->sftp->getExitStatus() !== 0) {
|
||||
throw new \RuntimeException($this->sftp->getStdError());
|
||||
$output = $this->sftp->getStdError() ?: $result;
|
||||
throw new \RuntimeException($output);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user