MCPcopy Create free account
hub / github.com/anchordotdev/cli / execKeytool

Method execKeytool

truststore/java.go:143–153  ·  view source on GitHub ↗

execKeytool will execute a "keytool" command and if needed re-execute the command with commandWithSudo to work around file permissions.

(cmd *exec.Cmd)

Source from the content-addressed store, hash-verified

141// execKeytool will execute a "keytool" command and if needed re-execute
142// the command with commandWithSudo to work around file permissions.
143func (s *Java) execKeytool(cmd *exec.Cmd) ([]byte, error) {
144 out, err := s.SysFS.Exec(cmd)
145 if err != nil && bytes.Contains(out, []byte("java.io.FileNotFoundException")) && runtime.GOOS != "windows" {
146 cmd = s.SysFS.Command(cmd.Args[0], cmd.Args[1:]...)
147 cmd.Env = []string{
148 "JAVA_HOME=" + s.JavaHomeDir,
149 }
150 return s.SysFS.SudoExec(cmd)
151 }
152 return out, err
153}

Callers 2

InstallCAMethod · 0.95
UninstallCAMethod · 0.95

Calls 3

ExecMethod · 0.65
CommandMethod · 0.65
SudoExecMethod · 0.65

Tested by

no test coverage detected