mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
allow directory to exist in Util.copyDir() (fixes #530)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user