1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-19 13:54:23 +01:00

Revert "Moving a sketch to another folder should move all files"

This reverts commit c4f5cafd332cac1de31c004502205e7f02eaec34.
This commit is contained in:
Cristian Maglie 2018-08-23 10:34:28 +02:00
parent 067d7e9252
commit 13c3750ecf
2 changed files with 1 additions and 8 deletions

View File

@ -38,7 +38,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.print.PageFormat;
@ -91,7 +90,6 @@ import cc.arduino.packages.BoardPort;
import cc.arduino.packages.MonitorFactory;
import cc.arduino.packages.Uploader;
import cc.arduino.packages.uploaders.SerialUploader;
import cc.arduino.view.Event;
import cc.arduino.view.GoToLineNumber;
import cc.arduino.view.StubMenuListener;
import cc.arduino.view.findreplace.FindReplace;
@ -99,7 +97,6 @@ import jssc.SerialPortException;
import processing.app.debug.RunnerException;
import processing.app.forms.PasswordAuthorizationDialog;
import processing.app.helpers.DocumentTextChangeListener;
import processing.app.helpers.FileUtils;
import processing.app.helpers.Keys;
import processing.app.helpers.OSUtils;
import processing.app.helpers.PreferencesMapException;
@ -1782,7 +1779,7 @@ public class Editor extends JFrame implements RunnerListener {
// copy the sketch inside
File properPdeFile = new File(properFolder, sketchFile.getName());
try {
FileUtils.copy(new File(sketchFile.getParent()), properFolder);
Base.copyFile(sketchFile, properPdeFile);
} catch (IOException e) {
Base.showWarning(tr("Error"), tr("Could not copy to a proper location."), e);
return false;

View File

@ -58,10 +58,6 @@ 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);