Skip to content

Commit 3d084a2

Browse files
Randomize temporary sketch copy directory name
When a sketch has unsaved changes, a temporary copy of the sketch is made with those changes applied. This copy is then passed to arduino-builder. Previously, the name of this directory contained a hash of the main sketch filename, so the same directory would be used between builds. Now that this directory is deleted after every build, it can just use a randomized directory name, which is what this commit does. Addtionally, the prefix used for generating the name is changed from "arduino_" to "arduino_modified_sketch_" to make it slightly clearer what the directory is for (just in case it somehow survives the build, or a user sees it during the build).
1 parent 1d60c8b commit 3d084a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/processing/app/Sketch.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ private String build(String buildPath, boolean verbose, boolean save) throws Run
11191119
}
11201120

11211121
private String saveSketchInTempFolder() throws IOException {
1122-
File tempFolder = FileUtils.createTempFolder("arduino_", DigestUtils.md5Hex(data.getMainFilePath()));
1122+
File tempFolder = FileUtils.createTempFolder("arduino_modified_sketch_");
11231123
FileUtils.copy(getFolder(), tempFolder);
11241124

11251125
for (SketchCode sc : Stream.of(data.getCodes()).filter(SketchCode::isModified).collect(Collectors.toList())) {

0 commit comments

Comments
 (0)