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
This commit is contained in:
Adam Shannon
2018-11-26 09:03:40 -08:00
committed by Filippo Valsorda
parent afbc420fa0
commit 438ae98b1c

View File

@@ -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 {