We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 91cdf53 + beadf8f commit 144213fCopy full SHA for 144213f
arduino-core/src/processing/app/SketchFile.java
@@ -177,7 +177,7 @@ private boolean deleteCompiledFilesFrom(Path tempBuildFolder) throws IOException
177
public void renameTo(String newName) throws IOException {
178
File newFile = new File(file.getParentFile(), newName);
179
sketch.checkNewFilename(newFile);
180
- if (file.renameTo(newFile)) {
+ if (!file.exists() || file.renameTo(newFile)) {
181
renamedTo(newFile);
182
} else {
183
String msg = I18n.format(tr("Failed to rename \"{0}\" to \"{1}\""), file.getName(), newName);
0 commit comments