MCPcopy Create free account
hub / github.com/devspace-sh/devspace / getShell

Function getShell

helper/ssh/server.go:82–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80}
81
82func getShell() (string, error) {
83 // try to get a shell
84 _, err := exec.LookPath("bash")
85 if err != nil {
86 _, err := exec.LookPath("sh")
87 if err != nil {
88 return "", fmt.Errorf("neither 'bash' nor 'sh' found in container. Please make sure at least one is available in the container $PATH")
89 }
90
91 return "sh", nil
92 }
93
94 return "bash", nil
95}
96
97func (s *Server) handler(sess ssh.Session) {
98 cmd := s.getCommand(sess)

Callers 1

NewServerFunction · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected