mirror of https://github.com/sbt/sbt.git
Force download option
This commit is contained in:
parent
77fc66aae8
commit
9ccf972f8a
|
|
@ -18,6 +18,7 @@ case class Coursier(
|
|||
@ExtraName("D") javadoc: Boolean,
|
||||
@ExtraName("P") @ExtraName("cp") classpath: Boolean,
|
||||
@ExtraName("c") offline: Boolean,
|
||||
@ExtraName("f") force: Boolean,
|
||||
@ExtraName("v") verbose: List[Unit],
|
||||
@ExtraName("N") maxIterations: Int = 100,
|
||||
@ExtraName("r") repository: List[String],
|
||||
|
|
@ -36,6 +37,12 @@ case class Coursier(
|
|||
def println(s: String) = Console.err.println(s)
|
||||
|
||||
|
||||
if (force && offline) {
|
||||
println("Error: --offline (-c) and --force (-f) options can't be specified at the same time.")
|
||||
sys.exit(255)
|
||||
}
|
||||
|
||||
|
||||
def defaultLogger: MavenRepository.Logger with Files.Logger =
|
||||
new MavenRepository.Logger with Files.Logger {
|
||||
def downloading(url: String) =
|
||||
|
|
@ -85,6 +92,8 @@ case class Coursier(
|
|||
implicit val cachePolicy =
|
||||
if (offline)
|
||||
CachePolicy.LocalOnly
|
||||
else if (force)
|
||||
CachePolicy.ForceDownload
|
||||
else
|
||||
CachePolicy.Default
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue