allow directory to exist in Util.copyDir() (fixes #530)

This commit is contained in:
Ben Fry
2022-08-09 10:27:31 -04:00
parent 05fc58fd92
commit 397c6e375f
3 changed files with 6 additions and 4 deletions
+3 -3
View File
@@ -1280,9 +1280,9 @@ public class Base {
handleOpenUntitled(path);
} catch (IOException e) {
Messages.showWarning("That's new to me",
"A strange and unexplainable error occurred\n" +
"while trying to create a new sketch.", e);
Messages.showTrace("That's new to me",
"A strange and unexplainable error occurred\n" +
"while trying to create a new sketch.", e, false);
}
}
+1 -1
View File
@@ -264,7 +264,7 @@ public class Util {
final String urDum = "source and target directories are identical";
throw new IllegalArgumentException(urDum);
}
if (!targetDir.mkdirs()) {
if (!targetDir.exists() && !targetDir.mkdirs()) {
throw new IOException("Could not create " + targetDir);
}
String[] filenames = sourceDir.list();
+2
View File
@@ -1,4 +1,6 @@
1286 (4.0.1)
X Changing into p5.js mode gives an error
X https://github.com/processing/processing4/issues/530
known issues