Skip to content

Commit

Permalink
Merge pull request #17 from melezov/path-separator-patch
Browse files Browse the repository at this point in the history
Fixed problems on Windows system which do not use the / path separator.
  • Loading branch information
softprops committed Feb 17, 2012
2 parents 5bd8e04 + a6f8b10 commit 248decb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/less.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 248decb

Please sign in to comment.