mirror of https://github.com/sbt/sbt.git
Add file existence check for Eugene.
This commit is contained in:
parent
ef9e88a115
commit
2b3f34f6f6
|
|
@ -304,11 +304,12 @@ object Resolver {
|
||||||
private[this] def mavenLocalDir: File = {
|
private[this] def mavenLocalDir: File = {
|
||||||
def loadHomeFromSettings(f: () => File): Option[File] =
|
def loadHomeFromSettings(f: () => File): Option[File] =
|
||||||
try {
|
try {
|
||||||
val file = XML.loadFile(f())
|
val file = f()
|
||||||
(file \ "localRepository").text match {
|
if(!file.exists) None
|
||||||
|
else ((XML.loadFile(file) \ "localRepository").text match {
|
||||||
case "" => None
|
case "" => None
|
||||||
case e @ _ => Some(new File(e))
|
case e @ _ => Some(new File(e))
|
||||||
}
|
})
|
||||||
} catch {
|
} catch {
|
||||||
// Occurs inside File constructor when property or environment variable does not exist
|
// Occurs inside File constructor when property or environment variable does not exist
|
||||||
case _: NullPointerException => None
|
case _: NullPointerException => None
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue