From 397c6e375fca9d645fc63711c256300bb5ce3f3c Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Tue, 9 Aug 2022 10:27:31 -0400 Subject: [PATCH] allow directory to exist in Util.copyDir() (fixes #530) --- app/src/processing/app/Base.java | 6 +++--- app/src/processing/app/Util.java | 2 +- todo.txt | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 7cc295433..e3c2ca2ca 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -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); } } diff --git a/app/src/processing/app/Util.java b/app/src/processing/app/Util.java index 373415c4d..c27cf9e96 100644 --- a/app/src/processing/app/Util.java +++ b/app/src/processing/app/Util.java @@ -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(); diff --git a/todo.txt b/todo.txt index b310ea02b..93fe6eeba 100755 --- a/todo.txt +++ b/todo.txt @@ -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