Skip to content

Commit

Permalink
Added support for windows systems
Browse files Browse the repository at this point in the history
  • Loading branch information
dansimpson committed Jun 23, 2011
1 parent 11531f2 commit bbc3158
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions core/src/main/scala/org/ds/satchel/Satchel.scala
Expand Up @@ -267,13 +267,12 @@ class Satchel(val name: String,
* Strip the root from the file path
*/
private def filename(path: String): String = {
path.replaceFirst(root, "")
path.replace('\\','/').replaceFirst(root, "")
}

private def glob(patterns: List[String]): List[String] = {
patterns.map { pattern: String =>
FileUtil.eglob(root + "/" + pattern)
//util.eglob(root + "/" + pattern)
}.flatten.removeDuplicates
}

Expand Down
Expand Up @@ -33,7 +33,7 @@ class JstProcessor extends SatchelProcessor {
}

override def process(path:String, content:String):String = {
"JST[\"" + path + "\"] = \"" + clean(content) + "\";";
"JST[\"" + path.replace('\\','/') + "\"] = \"" + clean(content) + "\";";
}

private def clean(content:String) = {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/org/ds/satchel/util/FileUtil.scala
Expand Up @@ -35,7 +35,7 @@ object FileUtil {
val result = new RichFile(new File(root)).tree.map(_.toString)

result.filter { p =>
val itr = regex.findAllIn(p)
val itr = regex.findAllIn(p.replace('\\','/'))
itr.size > 0
}.toList.reverse
}
Expand Down

0 comments on commit bbc3158

Please sign in to comment.