mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
[ci-skip] Make it easier to fork Purpur using our scripts
This commit is contained in:
@@ -15,12 +15,18 @@ internal fun Project.createSetupUpstreamTask(
|
|||||||
receiver(this)
|
receiver(this)
|
||||||
group = taskGroup
|
group = taskGroup
|
||||||
doLast {
|
doLast {
|
||||||
// this whole thing assumes we're forking either paper or a byof project atm
|
val setupUpstreamCommand = if (upstreamDir.resolve(toothpick.upstreamLowercase).exists()) {
|
||||||
val result = bashCmd(
|
"./${toothpick.upstreamLowercase} patch"
|
||||||
"./${toothpick.upstreamLowercase} patch",
|
} else if (
|
||||||
dir = upstreamDir,
|
upstreamDir.resolve("build.gradle.kts").exists()
|
||||||
printOut = true
|
&& upstreamDir.resolve("subprojects/server.gradle.kts").exists()
|
||||||
)
|
&& upstreamDir.resolve("subprojects/api.gradle.kts").exists()
|
||||||
|
) {
|
||||||
|
"./gradlew applyPatches"
|
||||||
|
} else {
|
||||||
|
error("Don't know how to setup upstream!")
|
||||||
|
}
|
||||||
|
val result = bashCmd(setupUpstreamCommand, dir = upstreamDir, printOut = true)
|
||||||
if (result.exitCode != 0) {
|
if (result.exitCode != 0) {
|
||||||
error("Failed to apply upstream patches: script exited with code ${result.exitCode}")
|
error("Failed to apply upstream patches: script exited with code ${result.exitCode}")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user