From: Charles McGarvey Date: Fri, 11 Jan 2013 23:27:37 +0000 (-0700) Subject: try to create ancestor directories of the tap file X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=89b9b5242336c7e2bfe27464ab203846f73969b6;p=chaz%2Fsbt-tap try to create ancestor directories of the tap file --- diff --git a/src/main/scala/SbtTapReporting.scala b/src/main/scala/SbtTapReporting.scala index 531a86b..eb6eac4 100644 --- a/src/main/scala/SbtTapReporting.scala +++ b/src/main/scala/SbtTapReporting.scala @@ -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) =