Skip to content

Commit

Permalink
Fix exception on init with Termux; Related #74
Browse files Browse the repository at this point in the history
  • Loading branch information
juraj-hrivnak committed Jan 4, 2025
1 parent 77aa9df commit a1ad3db
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/commonMain/kotlin/teksturepako/pakku/cli/cmd/Init.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import com.github.ajalt.clikt.core.terminal
import com.github.ajalt.mordant.input.interactiveSelectList
import com.github.ajalt.mordant.terminal.prompt
import com.github.ajalt.mordant.terminal.success
import com.github.michaelbull.result.get
import com.github.michaelbull.result.getOrElse
import com.github.michaelbull.result.onFailure
import com.github.michaelbull.result.runCatching
import kotlinx.coroutines.runBlocking
import teksturepako.pakku.api.data.ConfigFile
import teksturepako.pakku.api.data.LockFile
Expand Down Expand Up @@ -71,11 +75,18 @@ class Init : CliktCommand()

// -- TARGET --


with(
terminal.interactiveSelectList(
listOf("curseforge", "modrinth", "multiplatform"),
title = "? Target",
) ?: return@runBlocking
runCatching {
terminal.interactiveSelectList(
listOf("curseforge", "modrinth", "multiplatform"),
title = "? Target",
)
}
.getOrElse {
terminal.prompt("? Target", choices = listOf("curseforge", "modrinth", "multiplatform"))
}
?: return@runBlocking
)
{
lockFile.setTarget(this)
Expand Down

0 comments on commit a1ad3db

Please sign in to comment.