MCPcopy Create free account
hub / github.com/gogs/gogs / openSSHVersion

Function openSSHVersion

internal/conf/utils.go:21–29  ·  view source on GitHub ↗

openSSHVersion returns string representation of OpenSSH version via command "ssh -V".

()

Source from the content-addressed store, hash-verified

19
20// openSSHVersion returns string representation of OpenSSH version via command "ssh -V".
21func openSSHVersion() (string, error) {
22 // NOTE: Somehow the version is printed to stderr.
23 _, stderr, err := process.Exec("conf.openSSHVersion", "ssh", "-V")
24 if err != nil {
25 return "", errors.Wrap(err, stderr)
26 }
27
28 return cleanUpOpenSSHVersion(stderr), nil
29}
30
31// ensureAbs prepends the WorkDir to the given path if it is not an absolute path.
32func ensureAbs(path string) string {

Callers 1

InitFunction · 0.85

Calls 2

ExecFunction · 0.92
cleanUpOpenSSHVersionFunction · 0.85

Tested by

no test coverage detected