Skip to content

Commit c62f62c

Browse files
committed
Store temporary sketch in a folder named as the sketch
Previously the sketch was saved directly in the temporary folder: /tmp/arduino_modified_sketch_66288/Blink.ino this is not a correct Arduino sketch, now it is saved in: /tmp/arduino_modified_sketch_66288/Blink/Blink.ino
1 parent 95ccb80 commit c62f62c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/src/processing/app/SketchController.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,11 @@ public String build(boolean verbose, boolean save) throws RunnerException, Prefe
671671
}
672672

673673
private File saveSketchInTempFolder() throws IOException {
674-
File tempFolder = FileUtils.createTempFolder("arduino_modified_sketch_");
674+
File temp = FileUtils.createTempFolder("arduino_modified_sketch_");
675+
File tempFolder = new File(temp, getSketch().getName());
676+
if (!tempFolder.mkdir()) {
677+
throw new IOException("Can't create directory to store temp sketch.");
678+
}
675679
FileUtils.copy(sketch.getFolder(), tempFolder);
676680

677681
for (SketchFile file : Stream.of(sketch.getFiles()).filter(SketchFile::isModified).collect(Collectors.toList())) {

0 commit comments

Comments
 (0)