Skip to content

Commit

Permalink
Merge pull request #265 from spyrkob/WFGP-257
Browse files Browse the repository at this point in the history
[WFGP-257] Use linux path separator in artifact cache record
  • Loading branch information
jfdenise authored Oct 5, 2023
2 parents 7fa275b + 2fc0ac9 commit bee5061
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 bee5061

Please sign in to comment.