mirror of
https://github.com/FiloSottile/mkcert.git
synced 2025-10-14 00:41:40 +08:00
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
This commit is contained in:

committed by
Filippo Valsorda

parent
438ae98b1c
commit
ea716f38b3
@@ -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).
|
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
|
## Supported root stores
|
||||||
|
|
||||||
mkcert supports the following root stores:
|
mkcert supports the following root stores:
|
||||||
|
@@ -112,7 +112,7 @@ func (m *mkcert) uninstallJava() {
|
|||||||
// the command wrapped in 'sudo' to work around file permissions.
|
// the command wrapped in 'sudo' to work around file permissions.
|
||||||
func (m *mkcert) execKeytool(cmd *exec.Cmd) ([]byte, error) {
|
func (m *mkcert) execKeytool(cmd *exec.Cmd) ([]byte, error) {
|
||||||
out, err := cmd.CombinedOutput()
|
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:]
|
origArgs := cmd.Args[1:]
|
||||||
cmd = exec.Command("sudo", keytoolPath)
|
cmd = exec.Command("sudo", keytoolPath)
|
||||||
cmd.Args = append(cmd.Args, origArgs...)
|
cmd.Args = append(cmd.Args, origArgs...)
|
||||||
|
Reference in New Issue
Block a user