diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-02 12:37:03 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-02 12:37:03 -0400 |
commit | ae0f718c39b1dadf706944b558f0ce5457461b97 (patch) | |
tree | 7aa9e33c8d6f1f43f5038e11389d7d9fcbd33e9e /stage2/Scaffold.scala | |
parent | 57de43907e05d4cd3986e2994e0e3bff93e09b4e (diff) | |
download | cbt-ae0f718c39b1dadf706944b558f0ce5457461b97.tar.gz cbt-ae0f718c39b1dadf706944b558f0ce5457461b97.tar.bz2 cbt-ae0f718c39b1dadf706944b558f0ce5457461b97.zip |
Fix BasicBuild file scaffolding (creating folder if necessary)
Diffstat (limited to 'stage2/Scaffold.scala')
-rw-r--r-- | stage2/Scaffold.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stage2/Scaffold.scala b/stage2/Scaffold.scala index 620d4fb..3dcb9ae 100644 --- a/stage2/Scaffold.scala +++ b/stage2/Scaffold.scala @@ -6,7 +6,9 @@ trait Scaffold{ def logger: Logger private def createFile( projectDirectory: File, fileName: String, code: String ){ - Files.write( ( projectDirectory ++ ("/" ++ fileName) ).toPath, code.getBytes, StandardOpenOption.CREATE_NEW ) + val outputFile = projectDirectory ++ ("/" ++ fileName) + outputFile.getParentFile.mkdirs + Files.write( ( outputFile ).toPath, code.getBytes, StandardOpenOption.CREATE_NEW ) import scala.Console._ println( GREEN ++ "Created " ++ fileName ++ RESET ) } |