File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
modules/cli/src/main/scala/scala/cli/commands Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,22 @@ final case class CoursierOptions(
12
12
@ HelpMessage (" Specify a TTL for changing dependencies, such as snapshots" )
13
13
@ ValueDescription (" duration|Inf" )
14
14
@ Hidden
15
- ttl : Option [String ] = None
15
+ ttl : Option [String ] = None ,
16
+ @ Group (" Dependency" )
17
+ @ HelpMessage (" Set the coursier cache location" )
18
+ @ ValueDescription (" path" )
19
+ @ Hidden
20
+ cache : Option [String ] = None
16
21
) {
17
22
// format: on
18
23
def coursierCache (logger : CacheLogger ) = {
19
- val baseCache = FileCache ()
20
- val ttl0 = ttl.map(_.trim).filter(_.nonEmpty).map(Duration (_)).orElse(baseCache.ttl)
24
+ var baseCache = FileCache ().withLogger(logger)
25
+ val ttlOpt = ttl.map(_.trim).filter(_.nonEmpty).map(Duration (_))
26
+ for (ttl0 <- ttlOpt)
27
+ baseCache = baseCache.withTtl(ttl0)
28
+ for (loc <- cache.filter(_.trim.nonEmpty))
29
+ baseCache = baseCache.withLocation(loc)
21
30
baseCache
22
- .withTtl(ttl0)
23
- .withLogger(logger)
24
31
}
25
32
}
26
33
Original file line number Diff line number Diff line change @@ -213,6 +213,10 @@ Available in commands:
213
213
214
214
Specify a TTL for changing dependencies, such as snapshots
215
215
216
+ #### ` --cache `
217
+
218
+ Set the coursier cache location
219
+
216
220
## Cross options
217
221
218
222
Available in commands:
You can’t perform that action at this time.
0 commit comments