Skip to content

Commit 95e833a

Browse files
committed
Copy items from output instead of move (makes integration tests happier)
1 parent 42f3b84 commit 95e833a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/main/java/gr/gousiosg/javacg/stat/support/RepoTool.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@ private void moveFiles(Path sourceDir, Path targetDir, String glob) throws IOExc
199199
}
200200
}
201201

202+
private void copyFiles(Path sourceDir, Path targetDir, String glob) throws IOException {
203+
try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(sourceDir, glob)) {
204+
for (Path source: dirStream) {
205+
Files.copy(
206+
source,
207+
targetDir.resolve(source.getFileName()),
208+
StandardCopyOption.REPLACE_EXISTING);
209+
}
210+
}
211+
}
212+
213+
202214
private void moveJacoco(String property, long timeElapsed) throws IOException{
203215
String projectDir = getProjectDir();
204216
String directoryPath = System.getProperty("user.dir") + "/artifacts/results/" + projectDir + timeStamp;
@@ -233,7 +245,7 @@ private void moveJacoco(String property, long timeElapsed) throws IOException{
233245
}
234246

235247
public void moveOutput() throws Exception {
236-
moveFiles(
248+
copyFiles(
237249
Paths.get(System.getProperty("user.dir"), "/output"), // src
238250
Paths.get(System.getProperty("user.dir"), "/artifacts/results/", getProjectDir() + timeStamp), // dst
239251
"*.*" // g;ob

0 commit comments

Comments
 (0)