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("D") javadoc: Boolean,
|
||||||
@ExtraName("P") @ExtraName("cp") classpath: Boolean,
|
@ExtraName("P") @ExtraName("cp") classpath: Boolean,
|
||||||
@ExtraName("c") offline: Boolean,
|
@ExtraName("c") offline: Boolean,
|
||||||
|
@ExtraName("f") force: Boolean,
|
||||||
@ExtraName("v") verbose: List[Unit],
|
@ExtraName("v") verbose: List[Unit],
|
||||||
@ExtraName("N") maxIterations: Int = 100,
|
@ExtraName("N") maxIterations: Int = 100,
|
||||||
@ExtraName("r") repository: List[String],
|
@ExtraName("r") repository: List[String],
|
||||||
|
|
@ -36,6 +37,12 @@ case class Coursier(
|
||||||
def println(s: String) = Console.err.println(s)
|
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 =
|
def defaultLogger: MavenRepository.Logger with Files.Logger =
|
||||||
new MavenRepository.Logger with Files.Logger {
|
new MavenRepository.Logger with Files.Logger {
|
||||||
def downloading(url: String) =
|
def downloading(url: String) =
|
||||||
|
|
@ -85,6 +92,8 @@ case class Coursier(
|
||||||
implicit val cachePolicy =
|
implicit val cachePolicy =
|
||||||
if (offline)
|
if (offline)
|
||||||
CachePolicy.LocalOnly
|
CachePolicy.LocalOnly
|
||||||
|
else if (force)
|
||||||
|
CachePolicy.ForceDownload
|
||||||
else
|
else
|
||||||
CachePolicy.Default
|
CachePolicy.Default
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue