]> Dogcows Code - chaz/sbt-tap/commitdiff
try to create ancestor directories of the tap file
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Fri, 11 Jan 2013 23:27:37 +0000 (16:27 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Fri, 11 Jan 2013 23:34:42 +0000 (16:34 -0700)
src/main/scala/SbtTapReporting.scala

index 531a86b463b9af88ba0650108a2779788268a96e..eb6eac44c42b34e8054ae779b6a91e248da5deaa 100644 (file)
@@ -21,11 +21,10 @@ class SbtTapListener extends TestsListener {
   var fileWriter: FileWriter = _
 
   override def doInit = {
-    new File("test-results").mkdirs
-
-    fileWriter = new FileWriter(
-      scala.util.Properties.envOrElse("SBT_TAP_OUTPUT", "test-results/test.tap")
-    )
+    val filename = scala.util.Properties.envOrElse("SBT_TAP_OUTPUT", "test-results/test.tap")
+    val file = new File(filename)
+    new File(file.getParent).mkdirs
+    fileWriter = new FileWriter(file)
   }
 
   def startGroup(name: String) =
This page took 0.021659 seconds and 4 git commands to generate.