diff options
author | Linnea Gräf <nea@nea.moe> | 2025-03-18 19:28:15 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-03-18 19:28:15 +0100 |
commit | 40ce4f856718d6b0c7fa15cd40a1f6db2f774e6f (patch) | |
tree | 0f7f4f2f4782ebb04ea0657bc3a614a35582e973 /src/main/kotlin/commands/rome.kt | |
parent | 3ca60f0daa5db9060fa23510ea8362563357c43a (diff) | |
download | Firmament-40ce4f856718d6b0c7fa15cd40a1f6db2f774e6f.tar.gz Firmament-40ce4f856718d6b0c7fa15cd40a1f6db2f774e6f.tar.bz2 Firmament-40ce4f856718d6b0c7fa15cd40a1f6db2f774e6f.zip |
feat: Allow checking out repo PRs
Diffstat (limited to 'src/main/kotlin/commands/rome.kt')
-rw-r--r-- | src/main/kotlin/commands/rome.kt | 10 |
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 { |