1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-17 06:52:18 +01:00

Better naming and use of File constructor (avoids hardcoding system dependent path separator)

This commit is contained in:
Federico Fissore 2015-05-13 10:21:57 +02:00
parent 90a533b82c
commit 74ace6674a

View File

@ -1159,15 +1159,15 @@ public class Compiler implements MessageConsumer {
dict.put("ide_version", "" + BaseNoGui.REVISION); dict.put("ide_version", "" + BaseNoGui.REVISION);
try { try {
String tmp_file = prefs.getOrExcept("recipe.output.tmp_file"); String compiledSketch = prefs.getOrExcept("recipe.output.tmp_file");
tmp_file = StringReplacer.replaceFromMapping(tmp_file, dict); compiledSketch = StringReplacer.replaceFromMapping(compiledSketch, dict);
String save_file = prefs.getOrExcept("recipe.output.save_file"); String copyOfCompiledSketch = prefs.getOrExcept("recipe.output.save_file");
save_file = StringReplacer.replaceFromMapping(save_file, dict); copyOfCompiledSketch = StringReplacer.replaceFromMapping(copyOfCompiledSketch, dict);
File hexFile = new File(prefs.get("build.path") + "/" + tmp_file); File compiledSketchFile = new File(prefs.get("build.path"), compiledSketch);
File saveFile = new File(sketch.getFolder().getAbsolutePath() + "/" + save_file); File copyOfCompiledSketchFile = new File(sketch.getFolder(), copyOfCompiledSketch);
FileUtils.copyFile(hexFile, saveFile); FileUtils.copyFile(compiledSketchFile, copyOfCompiledSketchFile);
} catch (Exception e) { } catch (Exception e) {
throw new RunnerException(e); throw new RunnerException(e);
} }