Skip to content

Commit 74ace66

Browse files
author
Federico Fissore
committed
Better naming and use of File constructor (avoids hardcoding system dependent path separator)
1 parent 90a533b commit 74ace66

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

arduino-core/src/processing/app/debug/Compiler.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -1159,15 +1159,15 @@ void saveHex() throws RunnerException {
11591159
dict.put("ide_version", "" + BaseNoGui.REVISION);
11601160

11611161
try {
1162-
String tmp_file = prefs.getOrExcept("recipe.output.tmp_file");
1163-
tmp_file = StringReplacer.replaceFromMapping(tmp_file, dict);
1164-
String save_file = prefs.getOrExcept("recipe.output.save_file");
1165-
save_file = StringReplacer.replaceFromMapping(save_file, dict);
1162+
String compiledSketch = prefs.getOrExcept("recipe.output.tmp_file");
1163+
compiledSketch = StringReplacer.replaceFromMapping(compiledSketch, dict);
1164+
String copyOfCompiledSketch = prefs.getOrExcept("recipe.output.save_file");
1165+
copyOfCompiledSketch = StringReplacer.replaceFromMapping(copyOfCompiledSketch, dict);
11661166

1167-
File hexFile = new File(prefs.get("build.path") + "/" + tmp_file);
1168-
File saveFile = new File(sketch.getFolder().getAbsolutePath() + "/" + save_file);
1167+
File compiledSketchFile = new File(prefs.get("build.path"), compiledSketch);
1168+
File copyOfCompiledSketchFile = new File(sketch.getFolder(), copyOfCompiledSketch);
11691169

1170-
FileUtils.copyFile(hexFile, saveFile);
1170+
FileUtils.copyFile(compiledSketchFile, copyOfCompiledSketchFile);
11711171
} catch (Exception e) {
11721172
throw new RunnerException(e);
11731173
}

0 commit comments

Comments
 (0)