1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-30 19:52:13 +01:00
This commit is contained in:
Federico Fissore 2012-12-12 16:25:52 +01:00
parent 15a7ebe568
commit 4011f480d1
2 changed files with 16 additions and 3 deletions

View File

@ -612,7 +612,7 @@ public class Sketch {
} else {
// delete the file
if (!current.deleteFile()) {
if (!current.deleteFile(tempBuildFolder)) {
Base.showMessage(_("Couldn't do it"),
I18n.format(_("Could not delete \"{0}\"."), current.getFileName()));
return;

View File

@ -107,8 +107,21 @@ public class SketchCode {
}
protected boolean deleteFile() {
return file.delete();
protected boolean deleteFile(File tempBuildFolder) {
if (!file.delete()) {
return false;
}
File[] compiledFiles = tempBuildFolder.listFiles(new FileFilter() {
public boolean accept(File pathname) {
return pathname.getName().startsWith(getFileName());
}
});
for (File compiledFile : compiledFiles) {
compiledFile.delete();
}
return true;
}