Skip to content

Commit

Permalink
fix: now taking into account --no-links when copying
Browse files Browse the repository at this point in the history
Before we wouldn't override existing artifacts if they existed, even if
they were of the "wrong" type (e.g. a link when --no-links was specified).
Now we do.
  • Loading branch information
quintesse committed Jul 3, 2024
1 parent 447245e commit 8bf8c11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/codejive/jpm/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ static class QuietMixin {
}

private static void printStats(SyncStats stats) {
System.err.printf("Artifacts copied: %d, deleted: %d%n", stats.copied, stats.deleted);
System.err.printf(
"Artifacts new: %d, updated: %d, deleted: %d%n",
stats.copied, stats.updated, stats.deleted);
}

public static void main(String... args) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/codejive/jpm/util/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public static SyncStats syncArtifacts(
copyDependency(artifact, directory, noLinks);
artifactsToDelete.remove(artifactName);
stats.copied++;
} else if (Files.isSymbolicLink(target) == noLinks) {
copyDependency(artifact, directory, noLinks);
stats.updated++;
}
}

Expand Down

0 comments on commit 8bf8c11

Please sign in to comment.