1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-12-23 23:30:22 +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
if (outputParent.exists()) {
if (!outputParent.canWrite || !outputParent.isDirectory) {
errorReporting.warn(s"The output directory `${outputParent.getAbsolutePath}` cannot be written to.")
}
} else {
if (!outputParent.mkdirs()) {
errorReporting.warn(s"Failed to create the output directory `${outputParent.getAbsolutePath}``")
if (outputParent ne null) {
if (outputParent.exists()) {
if (!outputParent.canWrite || !outputParent.isDirectory) {
errorReporting.warn(s"The output directory `${outputParent.getAbsolutePath}` cannot be written to.")
}
} else {
if (!outputParent.mkdirs()) {
errorReporting.warn(s"Failed to create the output directory `${outputParent.getAbsolutePath}``")
}
}
}