Permalink
Browse files

Merge pull request #17 from melezov/path-separator-patch

Fixed problems on Windows system which do not use the / path separator.
  • Loading branch information...
2 parents 5bd8e04 + a6f8b10 commit 248decb8216036b759220616c2a7999ac11f8ac3 @softprops committed Feb 17, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/main/scala/less.scala
@@ -20,16 +20,16 @@ object Plugin extends sbt.Plugin {
class LessSourceFile(val lessFile: File, sourcesDir: File, targetDir: File, cssDir: File) {
val relPath = IO.relativize(sourcesDir, lessFile).get
- lazy val cssFile = new File(cssDir, relPath.replace(".less",".css"))
- lazy val importsFile = new File(targetDir, relPath + ".imports");
+ lazy val cssFile = new File(cssDir, relPath.replaceFirst("\\.less$",".css"))
+ lazy val importsFile = new File(targetDir, relPath + ".imports")
lazy val parentDir = lessFile.getParentFile
def imports = IO.read(importsFile).split(ImportsDelimiter).collect {
case fileName if fileName.trim.length > 0 => new File(parentDir, fileName)
}
def changed = !importsFile.exists || (lessFile newerThan cssFile) || (imports exists (_ newerThan cssFile))
- def path = lessFile.getPath
+ def path = lessFile.getPath.replace('\\', '/')
override def toString = lessFile.toString
}

0 comments on commit 248decb

Please sign in to comment.