Browse Source

java: don't try to run keytool during check if it's not available (#90)

If JAVA_HOME isn't set then keytoolPath has an invalid path. This means
checkJava() fails and doesn't tell the problem clearly to the user.

Fixes #88
Adam Shannon 6 years ago
parent
commit
438ae98b1c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      truststore_java.go

+ 4 - 0
truststore_java.go

@@ -58,6 +58,10 @@ func init() {
 }
 
 func (m *mkcert) checkJava() bool {
+	if !hasKeytool {
+		return false
+	}
+
 	// exists returns true if the given x509.Certificate's fingerprint
 	// is in the keytool -list output
 	exists := func(c *x509.Certificate, h hash.Hash, keytoolOutput []byte) bool {