Skip to content

Commit c8cac5e

Browse files
committed
Skip copying in already-existing library imports for forks
They likely exist due to being imported by upstream
1 parent 44ab556 commit c8cac5e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/SetupForkMinecraftSources.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ abstract class SetupForkMinecraftSources : JavaLauncherTask() {
8181
}
8282

8383
if (libraryImports.isPresent) {
84-
libraryImports.path.copyRecursivelyTo(out)
84+
libraryImports.path.walk().forEach {
85+
val outFile = out.resolve(it.relativeTo(libraryImports.path).invariantSeparatorsPathString)
86+
// The file may already exist if upstream imported it
87+
if (!outFile.exists()) {
88+
it.copyTo(outFile.createParentDirectories())
89+
}
90+
}
8591

8692
commitAndTag(git, "Imports", "${identifier.get()} Imports")
8793
}

0 commit comments

Comments
 (0)