mirror of https://github.com/sbt/sbt.git
Generate an error when making a path string from paths containing the separator. Fixes #1038.
This is an attempt to provide a decent error message in some cases. However, paths that include the Java path separator character are just fundamentally problematic and aren't always going to be cleanly detected.
This commit is contained in:
parent
5df24e5eb2
commit
ca4b22e272
|
|
@ -68,7 +68,11 @@ object Path extends PathExtra
|
|||
|
||||
def absolute(file: File): File = new File(file.toURI.normalize).getAbsoluteFile
|
||||
def makeString(paths: Seq[File]): String = makeString(paths, pathSeparator)
|
||||
def makeString(paths: Seq[File], sep: String): String = paths.map(_.getAbsolutePath).mkString(sep)
|
||||
def makeString(paths: Seq[File], sep: String): String = {
|
||||
val separated = paths.map(_.getAbsolutePath)
|
||||
separated.find(_ contains sep).foreach( p => sys.error(s"Path '$p' contains separator '$sep'") )
|
||||
separated.mkString(sep)
|
||||
}
|
||||
def newerThan(a: File, b: File): Boolean = a.exists && (!b.exists || a.lastModified > b.lastModified)
|
||||
|
||||
/** The separator character of the platform.*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue