1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-12-24 15:29:23 +00:00

Fix for output directory creation (#21)

This commit is contained in:
Karol Stasiak 2020-01-03 16:13:54 +01:00
parent 5c96b7e463
commit b9cdd0ffff

View File

@ -76,13 +76,15 @@ object Main {
} }
val outputParent = new File(output).getParentFile val outputParent = new File(output).getParentFile
if (outputParent.exists()) { if (outputParent ne null) {
if (!outputParent.canWrite || !outputParent.isDirectory) { if (outputParent.exists()) {
errorReporting.warn(s"The output directory `${outputParent.getAbsolutePath}` cannot be written to.") if (!outputParent.canWrite || !outputParent.isDirectory) {
} errorReporting.warn(s"The output directory `${outputParent.getAbsolutePath}` cannot be written to.")
} else { }
if (!outputParent.mkdirs()) { } else {
errorReporting.warn(s"Failed to create the output directory `${outputParent.getAbsolutePath}``") if (!outputParent.mkdirs()) {
errorReporting.warn(s"Failed to create the output directory `${outputParent.getAbsolutePath}``")
}
} }
} }