Skip to content

Commit 8bf8c11

Browse files
committed
fix: now taking into account --no-links when copying
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.
1 parent 447245e commit 8bf8c11

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/org/codejive/jpm/Main.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ static class QuietMixin {
181181
}
182182

183183
private static void printStats(SyncStats stats) {
184-
System.err.printf("Artifacts copied: %d, deleted: %d%n", stats.copied, stats.deleted);
184+
System.err.printf(
185+
"Artifacts new: %d, updated: %d, deleted: %d%n",
186+
stats.copied, stats.updated, stats.deleted);
185187
}
186188

187189
public static void main(String... args) {

src/main/java/org/codejive/jpm/util/FileUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public static SyncStats syncArtifacts(
3737
copyDependency(artifact, directory, noLinks);
3838
artifactsToDelete.remove(artifactName);
3939
stats.copied++;
40+
} else if (Files.isSymbolicLink(target) == noLinks) {
41+
copyDependency(artifact, directory, noLinks);
42+
stats.updated++;
4043
}
4144
}
4245

0 commit comments

Comments
 (0)