Skip to content

Commit

Permalink
fix: JLink can sync the last modified date.
Browse files Browse the repository at this point in the history
  • Loading branch information
teletha committed May 20, 2023
1 parent 1b61e8b commit 246596b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/bee/task/Exe.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ public File build() {
// copy java.exe
Platform.JavaHome.file("bin/java.exe").copyTo(jre.directory("bin"));

// sync last-modified datetime
jre.walkFileWithBase().to(copy -> {
File relativize = copy.ⅰ.relativize(copy.ⅱ);
File original = Platform.JavaHome.file(relativize);
if (original.isPresent()) {
copy.ⅱ.lastModifiedTime(original.lastModifiedMilli());
}
});

folder.add(jre);
}

Expand Down

0 comments on commit 246596b

Please sign in to comment.