mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-26 20:54:22 +01:00
Merge pull request #6388 from matthijskooijman/fix-renaming-new-files
Fix renaming of newly added files
This commit is contained in:
commit
144213fb8a
@ -177,7 +177,7 @@ public class SketchFile {
|
||||
public void renameTo(String newName) throws IOException {
|
||||
File newFile = new File(file.getParentFile(), newName);
|
||||
sketch.checkNewFilename(newFile);
|
||||
if (file.renameTo(newFile)) {
|
||||
if (!file.exists() || file.renameTo(newFile)) {
|
||||
renamedTo(newFile);
|
||||
} else {
|
||||
String msg = I18n.format(tr("Failed to rename \"{0}\" to \"{1}\""), file.getName(), newName);
|
||||
|
Loading…
x
Reference in New Issue
Block a user