MCPcopy
hub / github.com/lima-vm/lima / NewSSHExe

Function NewSSHExe

pkg/sshutil/sshutil.go:45–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43}
44
45func NewSSHExe() (SSHExe, error) {
46 var sshExe SSHExe
47
48 if sshShell := os.Getenv(EnvShellSSH); sshShell != "" {
49 sshShellFields, err := shellwords.Parse(sshShell)
50 switch {
51 case err != nil:
52 logrus.WithError(err).Warnf("Failed to split %s variable into shell tokens. "+
53 "Falling back to 'ssh' command", EnvShellSSH)
54 case len(sshShellFields) > 0:
55 sshExe.Exe = sshShellFields[0]
56 if len(sshShellFields) > 1 {
57 sshExe.Args = sshShellFields[1:]
58 }
59 return sshExe, nil
60 }
61 }
62
63 executable, err := exec.LookPath("ssh")
64 if err != nil {
65 return SSHExe{}, err
66 }
67 sshExe.Exe = executable
68
69 return sshExe, nil
70}
71
72type PubKey struct {
73 Filename string

Callers 9

CommandMethod · 0.92
checkRsyncOnGuestFunction · 0.92
CommandMethod · 0.92
requestStopViaSSHMethod · 0.92
newSFTPClientFunction · 0.92
NewFunction · 0.92
shellActionFunction · 0.92
showSSHActionFunction · 0.92
tunnelActionFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected