automatically create shared-zip directory

This commit is contained in:
Grische
2022-02-19 12:12:10 +00:00
committed by Sheepit Renderfarm
parent 5aa4f3c407
commit 55e485c4bc

View File

@@ -141,8 +141,16 @@ public class Worker {
if (sharedDownloadsDir != null) {
File dir = new File(sharedDownloadsDir);
if (dir.exists() == false || dir.canWrite() == false) {
System.err.println("ERROR: The shared-zip directory must exist and be writeable");
if (dir.exists() == false && dir.mkdirs()) {
Log.getInstance(config).debug("created shared-zip directory " + dir);
}
else if (dir.exists() == false) {
System.err.println("ERROR: The shared-zip directory " + dir + " does not exist and cannot be automatically created");
return;
}
if (dir.canWrite() == false) {
System.err.println("ERROR: The shared-zip directory " + dir + " must be writeable");
return;
}
config.setSharedDownloadsDirectory(dir);