mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-18 07:52:14 +01:00
Merge pull request #6041 from delftswa2017/bug/data-folder
Fix "save as" operation for the data folder of a sketch
This commit is contained in:
commit
14b3f9b1d6
@ -351,13 +351,22 @@ public class Sketch {
|
||||
file.saveAs(new File(newFolder, file.getFileName()));
|
||||
}
|
||||
|
||||
folder = newFolder;
|
||||
|
||||
// Copy the data folder (this may take a while.. add progress bar?)
|
||||
if (getDataFolder().exists()) {
|
||||
File newDataFolder = new File(newFolder, "data");
|
||||
// Check if data folder exits, if not try to create the data folder
|
||||
if (!newDataFolder.exists() && !newDataFolder.mkdirs()) {
|
||||
String msg = I18n.format(tr("Could not create directory \"{0}\""), newFolder.getAbsolutePath());
|
||||
throw new IOException(msg);
|
||||
}
|
||||
// Copy the data files into the new folder
|
||||
FileUtils.copy(getDataFolder(), newDataFolder);
|
||||
}
|
||||
|
||||
// Change folder to the new folder
|
||||
folder = newFolder;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user