Skip to content

Commit

Permalink
[WFGP-257] Use linux path separator in artifact cache record
Browse files Browse the repository at this point in the history
  • Loading branch information
spyrkob committed Oct 4, 2023
1 parent 7fa275b commit 2fc0ac9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.jboss.galleon.util.HashUtils;
import org.jboss.galleon.util.IoUtils;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down Expand Up @@ -103,7 +104,9 @@ public void writeCacheManifest() throws IOException {
final StringBuilder sb = new StringBuilder();
for (Map.Entry<String, Path> entry : cachedArtifacts.entrySet()) {
final String hash = HashUtils.hashFile(entry.getValue());
sb.append(entry.getKey()).append(SEPARATOR).append(hash).append(SEPARATOR).append(stagedDir.relativize(entry.getValue())).append("\n");
final Path relativePath = stagedDir.relativize(entry.getValue());
final String universalPath = relativePath.toString().replace(File.separatorChar, '/');
sb.append(entry.getKey()).append(SEPARATOR).append(hash).append(SEPARATOR).append(universalPath).append("\n");
}
Files.writeString(artifactList, sb.toString());
}
Expand Down

0 comments on commit 2fc0ac9

Please sign in to comment.