mirror of https://github.com/sbt/sbt.git
Handle absolute paths passed to Path.fromString
This commit is contained in:
parent
d3f02f7c80
commit
8caaabbdf4
|
|
@ -192,11 +192,17 @@ object Path extends Alternatives with Mapper
|
||||||
if(value.isEmpty)
|
if(value.isEmpty)
|
||||||
basePath
|
basePath
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
val f = new File(value)
|
||||||
|
if(f.isAbsolute)
|
||||||
|
fromFile(f)
|
||||||
|
else
|
||||||
{
|
{
|
||||||
val components = value.split("""[/\\]""")
|
val components = value.split("""[/\\]""")
|
||||||
(basePath /: components)( (path, component) => path / component )
|
(basePath /: components)( (path, component) => path / component )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
def baseAncestor(path: Path): Option[Path] =
|
def baseAncestor(path: Path): Option[Path] =
|
||||||
path match
|
path match
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue