From 89b9b5242336c7e2bfe27464ab203846f73969b6 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Fri, 11 Jan 2013 16:27:37 -0700 Subject: [PATCH] try to create ancestor directories of the tap file --- src/main/scala/SbtTapReporting.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) = -- 2.45.2