properly build from scratch

This commit is contained in:
Mark Harrah 2011-06-26 13:14:17 -04:00
parent c7885ce1ff
commit a0faaca824
1 changed files with 2 additions and 1 deletions

View File

@ -34,10 +34,11 @@ object Transform
{
def get(key: String): String = map.getOrElse(key, error("No value defined for key '" + key + "'"))
val newString = Property.replaceAllIn(IO.read(in), mtch => get(mtch.group(1)) )
if(newString != IO.read(out))
if(Some(newString) != read(out))
IO.write(out, newString)
out
}
def read(file: File): Option[String] = try { Some(IO.read(file)) } catch { case _: java.io.IOException => None }
lazy val Property = """\$\{\{([\w.-]+)\}\}""".r
def repositories(isSnapshot: Boolean) = Releases :: (if(isSnapshot) Snapshots :: Nil else Nil)