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:
parent
5c96b7e463
commit
b9cdd0ffff
@ -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}``")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user