MCPcopy Index your code
hub / github.com/FiloSottile/mkcert / execKeytool

Function execKeytool

truststore_java.go:110–122  ·  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

108// execKeytool will execute a "keytool" command and if needed re-execute
109// the command with commandWithSudo to work around file permissions.
110func execKeytool(cmd *exec.Cmd) ([]byte, error) {
111 out, err := cmd.CombinedOutput()
112 if err != nil && bytes.Contains(out, []byte("java.io.FileNotFoundException")) && runtime.GOOS != "windows" {
113 origArgs := cmd.Args[1:]
114 cmd = commandWithSudo(cmd.Path)
115 cmd.Args = append(cmd.Args, origArgs...)
116 cmd.Env = []string{
117 "JAVA_HOME=" + javaHome,
118 }
119 out, err = cmd.CombinedOutput()
120 }
121 return out, err
122}

Callers 2

installJavaMethod · 0.85
uninstallJavaMethod · 0.85

Calls 1

commandWithSudoFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…