Skip to content

Commit 67e32ff

Browse files
author
Federico Fissore
committed
FileUtils.copy now filters out source control folders. Also, dir is checked for existence before creating it. Fixes #4034
1 parent f5c3136 commit 67e32ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arduino-core/src/processing/app/helpers/FileUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ public static void copyFile(File source, File dest) throws IOException {
5858
public static void copy(File sourceFolder, File destFolder) throws IOException {
5959
for (File file : sourceFolder.listFiles()) {
6060
File destFile = new File(destFolder, file.getName());
61-
if (file.isDirectory()) {
62-
if (!destFile.mkdir()) {
61+
if (file.isDirectory() && !SOURCE_CONTROL_FOLDERS.contains(file.getName())) {
62+
if (!destFile.exists() && !destFile.mkdir()) {
6363
throw new IOException("Unable to create folder: " + destFile);
6464
}
6565
copy(file, destFile);
66-
} else {
66+
} else if (!file.isDirectory()) {
6767
copyFile(file, destFile);
6868
}
6969
}

0 commit comments

Comments
 (0)