From ea716f38b397410526c4951480aa39d0fbb795d7 Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Sat, 22 Dec 2018 14:10:28 -0800 Subject: [PATCH] java: don't attempt sudo retry on windows (#85) * java: don't attempt retry on windows * docs: mention "Run as Administrator" for windows if needed Fixes #84 --- README.md | 2 ++ truststore_java.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 960c967..5fb816d 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,8 @@ scoop install mkcert or build from source (requires Go 1.10+), or use [the pre-built binaries](https://github.com/FiloSottile/mkcert/releases). +If you're running into permission problems try running `mkcert` as an Administrator. + ## Supported root stores mkcert supports the following root stores: diff --git a/truststore_java.go b/truststore_java.go index aa7cd18..d618a70 100644 --- a/truststore_java.go +++ b/truststore_java.go @@ -112,7 +112,7 @@ func (m *mkcert) uninstallJava() { // the command wrapped in 'sudo' to work around file permissions. func (m *mkcert) execKeytool(cmd *exec.Cmd) ([]byte, error) { out, err := cmd.CombinedOutput() - if err != nil && bytes.Contains(out, []byte("java.io.FileNotFoundException")) { + if err != nil && bytes.Contains(out, []byte("java.io.FileNotFoundException")) && runtime.GOOS != "windows" { origArgs := cmd.Args[1:] cmd = exec.Command("sudo", keytoolPath) cmd.Args = append(cmd.Args, origArgs...)