Fix for: Coursier not resilient to changing local ivy cache directory #665 (#705)

* https://github.com/coursier/coursier/issues/665
This commit is contained in:
Tobi Akomolede AKA Mocuto 2017-12-06 09:20:57 -08:00 committed by Alexandre Archambault
parent 4ea6b9673f
commit da7fd6585f
1 changed files with 7 additions and 1 deletions

View File

@ -1073,8 +1073,14 @@ object Cache {
}
private lazy val ivy2HomeUri = {
val path =
sys.props.get("coursier.ivy.home")
.orElse(sys.props.get("ivy.home"))
.getOrElse(sys.props("user.home") + "/.ivy2/")
// a bit touchy on Windows... - don't try to manually write down the URI with s"file://..."
val str = new File(sys.props("user.home") + "/.ivy2/").toURI.toString
val str = new File(path).toURI.toString
if (str.endsWith("/"))
str
else