mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-28 09:24:14 +01:00
parent
73f40ac32e
commit
c4f5cafd33
@ -72,6 +72,8 @@ import java.util.ArrayList;
|
||||
import static processing.app.I18n.tr;
|
||||
import static processing.app.Theme.scale;
|
||||
|
||||
import processing.app.helpers.FileUtils;
|
||||
|
||||
/**
|
||||
* Main editor panel for the Processing Development Environment.
|
||||
*/
|
||||
@ -1935,7 +1937,7 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
// copy the sketch inside
|
||||
File properPdeFile = new File(properFolder, sketchFile.getName());
|
||||
try {
|
||||
Base.copyFile(sketchFile, properPdeFile);
|
||||
FileUtils.copy(new File(sketchFile.getParent()), properFolder);
|
||||
} catch (IOException e) {
|
||||
Base.showWarning(tr("Error"), tr("Could not copy to a proper location."), e);
|
||||
return false;
|
||||
|
@ -58,6 +58,10 @@ public class FileUtils {
|
||||
public static void copy(File sourceFolder, File destFolder) throws IOException {
|
||||
for (File file : sourceFolder.listFiles()) {
|
||||
File destFile = new File(destFolder, file.getName());
|
||||
if ((destFolder.getPath().equals(file.getPath()))) {
|
||||
// Avoid recursive copy of folders
|
||||
continue;
|
||||
}
|
||||
if (file.isDirectory() && !SOURCE_CONTROL_FOLDERS.contains(file.getName())) {
|
||||
if (!destFile.exists() && !destFile.mkdir()) {
|
||||
throw new IOException("Unable to create folder: " + destFile);
|
||||
|
Loading…
Reference in New Issue
Block a user