1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Throw error with docUrl.

This commit is contained in:
Cedric Beust 2015-12-03 01:52:05 -08:00
parent 03902ef366
commit 549ede3cea

View file

@ -33,10 +33,14 @@ class Kurl(val hostInfo: HostConfig) {
hostInfo.password = properties.getProperty(key)
}
}
fun error(s1: String, s2: String) {
throw KobaltException("Found \"$s1\" but not \"$s2\" in local.properties for $KEY.$host",
docUrl = "http://beust.com/kobalt/documentation/index.html#maven-repos-authenticated")
}
if (! hostInfo.username.isNullOrBlank() && hostInfo.password.isNullOrBlank()) {
throw KobaltException("Found \"username\" but not \"password\" in local.properties for $KEY.$host")
error("username", "password")
} else if(hostInfo.username.isNullOrBlank() && ! hostInfo.password.isNullOrBlank()) {
throw KobaltException("Found \"password\" but not \"username\" in local.properties for $KEY.$host")
error("password", "username")
}
}