aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/commands
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-03-18 19:28:15 +0100
committerLinnea Gräf <nea@nea.moe>2025-03-18 19:28:15 +0100
commit40ce4f856718d6b0c7fa15cd40a1f6db2f774e6f (patch)
tree0f7f4f2f4782ebb04ea0657bc3a614a35582e973 /src/main/kotlin/commands
parent3ca60f0daa5db9060fa23510ea8362563357c43a (diff)
downloadFirmament-40ce4f856718d6b0c7fa15cd40a1f6db2f774e6f.tar.gz
Firmament-40ce4f856718d6b0c7fa15cd40a1f6db2f774e6f.tar.bz2
Firmament-40ce4f856718d6b0c7fa15cd40a1f6db2f774e6f.zip
feat: Allow checking out repo PRs
Diffstat (limited to 'src/main/kotlin/commands')
-rw-r--r--src/main/kotlin/commands/rome.kt10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/kotlin/commands/rome.kt b/src/main/kotlin/commands/rome.kt
index 8ae34f6..c3eb03d 100644
--- a/src/main/kotlin/commands/rome.kt
+++ b/src/main/kotlin/commands/rome.kt
@@ -1,6 +1,7 @@
package moe.nea.firmament.commands
import com.mojang.brigadier.CommandDispatcher
+import com.mojang.brigadier.arguments.IntegerArgumentType
import com.mojang.brigadier.arguments.StringArgumentType.string
import io.ktor.client.statement.bodyAsText
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource
@@ -130,6 +131,15 @@ fun firmamentCommand() = literal("firmament") {
}
}
thenLiteral("repo") {
+ thenLiteral("checkpr") {
+ thenArgument("prnum", IntegerArgumentType.integer(1)) { prnum ->
+ thenExecute {
+ val prnum = this[prnum]
+ source.sendFeedback(tr("firmament.repo.reload.pr", "Temporarily reloading repo from PR #${prnum}."))
+ RepoManager.downloadOverridenBranch("refs/pull/$prnum/head")
+ }
+ }
+ }
thenLiteral("reload") {
thenLiteral("fetch") {
thenExecute {