Add file existence check for Eugene.

This commit is contained in:
Josh Suereth 2014-10-01 08:18:09 -04:00
parent b9dc9f8f4f
commit c84a5e70c7
1 changed files with 4 additions and 3 deletions

View File

@ -304,11 +304,12 @@ object Resolver {
private[this] def mavenLocalDir: File = {
def loadHomeFromSettings(f: () => File): Option[File] =
try {
val file = XML.loadFile(f())
(file \ "localRepository").text match {
val file = f()
if(!file.exists) None
else ((XML.loadFile(file) \ "localRepository").text match {
case "" => None
case e @ _ => Some(new File(e))
}
})
} catch {
// Occurs inside File constructor when property or environment variable does not exist
case _: NullPointerException => None