From 40ce4f856718d6b0c7fa15cd40a1f6db2f774e6f Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Tue, 18 Mar 2025 19:28:15 +0100 Subject: feat: Allow checking out repo PRs --- src/main/kotlin/commands/rome.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/kotlin/commands') 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 { -- cgit