mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Compiler: don't filter out existing sketch files, overwrite them. Fixes #3440
This commit is contained in:
parent
4313f2ab42
commit
9a01e30675
@ -29,6 +29,7 @@ import java.io.*;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import java.nio.file.StandardCopyOption;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@ -1416,11 +1417,10 @@ public class Compiler implements MessageConsumer {
|
|||||||
throw new RunnerException(e);
|
throw new RunnerException(e);
|
||||||
}
|
}
|
||||||
otherFilesStream.map((path) -> new Pair<>(path, Paths.get(buildPath, sketchPath.relativize(path).toString())))
|
otherFilesStream.map((path) -> new Pair<>(path, Paths.get(buildPath, sketchPath.relativize(path).toString())))
|
||||||
.filter((pair) -> !Files.exists(pair.value))
|
|
||||||
.forEach((pair) -> {
|
.forEach((pair) -> {
|
||||||
try {
|
try {
|
||||||
Files.createDirectories(pair.value.getParent());
|
Files.createDirectories(pair.value.getParent());
|
||||||
Files.copy(pair.key, pair.value);
|
Files.copy(pair.key, pair.value, StandardCopyOption.REPLACE_EXISTING);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new RuntimeException(I18n.format(_("Problem moving {0} to the build folder"), sketchPath.relativize(pair.key).toString()));
|
throw new RuntimeException(I18n.format(_("Problem moving {0} to the build folder"), sketchPath.relativize(pair.key).toString()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user