mirror of https://github.com/sbt/sbt.git
Handle whitespace in file resolver path (#68)
Fixes https://github.com/coursier/coursier/issues/1175
This commit is contained in:
parent
1499a15730
commit
745894efc5
|
|
@ -52,6 +52,11 @@ object Resolvers {
|
|||
None
|
||||
}
|
||||
|
||||
// this handles whitespace in path
|
||||
private def pathToUriString(path: String): String = {
|
||||
"file://" + path.replaceAllLiterally(" ", "%20")
|
||||
}
|
||||
|
||||
def repository(
|
||||
resolver: Resolver,
|
||||
ivyProperties: Map[String, String],
|
||||
|
|
@ -72,8 +77,8 @@ object Resolvers {
|
|||
case None =>
|
||||
|
||||
val repo = IvyRepository.parse(
|
||||
"file://" + r.patterns.artifactPatterns.head,
|
||||
metadataPatternOpt = Some("file://" + r.patterns.ivyPatterns.head),
|
||||
pathToUriString(r.patterns.artifactPatterns.head),
|
||||
metadataPatternOpt = Some(pathToUriString(r.patterns.ivyPatterns.head)),
|
||||
changing = Some(true),
|
||||
properties = ivyProperties,
|
||||
dropInfoAttributes = true,
|
||||
|
|
@ -90,7 +95,7 @@ object Resolvers {
|
|||
Some(repo)
|
||||
|
||||
case Some(mavenCompatibleBase) =>
|
||||
mavenRepositoryOpt("file://" + mavenCompatibleBase, log, authentication)
|
||||
mavenRepositoryOpt(pathToUriString(mavenCompatibleBase), log, authentication)
|
||||
}
|
||||
|
||||
case r: URLRepository if patternMatchGuard(r.patterns) =>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
scalaVersion := "2.11.8"
|
||||
|
||||
resolvers += Resolver.file("space-repo", file(raw"/tmp/space the final frontier/repo"))(Resolver.ivyStylePatterns)
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
addSbtPlugin {
|
||||
|
||||
val name = sys.props.getOrElse(
|
||||
"plugin.name",
|
||||
sys.error("plugin.name Java property not set")
|
||||
)
|
||||
val version = sys.props.getOrElse(
|
||||
"plugin.version",
|
||||
sys.error("plugin.version Java property not set")
|
||||
)
|
||||
|
||||
"io.get-coursier" % name % version
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
> update
|
||||
Loading…
Reference in New Issue