Message when initializing cache

This commit is contained in:
Alexandre Archambault 2015-07-07 12:29:26 +02:00
parent 7f774319e6
commit 72d29f5223
3 changed files with 8 additions and 2 deletions

View File

@ -108,6 +108,7 @@ case class Coursier(
CachePolicy.Default
val cache = Cache.default
cache.init(verbose = verbose0 >= 0)
val repositoryIds = {
val repository0 = repository

View File

@ -40,7 +40,7 @@ case class Repositories(
}
if (!cache.cache.exists())
cache.init()
cache.init(verbose = true)
val current = cache.list().map(_._1).toSet

View File

@ -63,8 +63,13 @@ case class Cache(cache: File) {
def addIvy2Local(): Unit =
add("ivy2local", new File(sys.props("user.home") + "/.ivy2/local/").toURI.toString, ivyLike = true)
def init(ifEmpty: Boolean = true): Unit =
def init(
ifEmpty: Boolean = true,
verbose: Boolean = false
): Unit =
if (!ifEmpty || !cache.exists()) {
if (verbose)
Console.err.println(s"Initializing $cache")
repoDir.mkdirs()
metadataBase.mkdirs()
fileBase.mkdirs()