diff --git a/src/commonMain/kotlin/teksturepako/pakku/Main.kt b/src/commonMain/kotlin/teksturepako/pakku/Main.kt index e675cc89..9644ca29 100644 --- a/src/commonMain/kotlin/teksturepako/pakku/Main.kt +++ b/src/commonMain/kotlin/teksturepako/pakku/Main.kt @@ -2,7 +2,6 @@ package teksturepako.pakku import com.github.ajalt.clikt.core.context import com.github.ajalt.clikt.core.subcommands -import com.github.ajalt.mordant.rendering.Theme import com.github.ajalt.mordant.terminal.Terminal import com.github.michaelbull.result.get import com.github.michaelbull.result.onFailure diff --git a/src/commonMain/kotlin/teksturepako/pakku/api/actions/export/rules/ServerPackRule.kt b/src/commonMain/kotlin/teksturepako/pakku/api/actions/export/rules/ServerPackRules.kt similarity index 88% rename from src/commonMain/kotlin/teksturepako/pakku/api/actions/export/rules/ServerPackRule.kt rename to src/commonMain/kotlin/teksturepako/pakku/api/actions/export/rules/ServerPackRules.kt index 6be46eeb..0d7716e6 100644 --- a/src/commonMain/kotlin/teksturepako/pakku/api/actions/export/rules/ServerPackRule.kt +++ b/src/commonMain/kotlin/teksturepako/pakku/api/actions/export/rules/ServerPackRules.kt @@ -3,14 +3,13 @@ package teksturepako.pakku.api.actions.export.rules import teksturepako.pakku.api.actions.export.ExportRule import teksturepako.pakku.api.actions.export.RuleContext.* import teksturepako.pakku.api.overrides.OverrideType -import teksturepako.pakku.api.projects.ProjectSide fun exportServerPack() = ExportRule { when (it) { is ExportingProject -> { - if (it.project.side != null && it.project.side !in listOf(ProjectSide.BOTH, ProjectSide.SERVER)) + if (OverrideType.fromProject(it.project) !in listOf(OverrideType.OVERRIDE, OverrideType.SERVER_OVERRIDE)) { it.ignore() } diff --git a/src/commonMain/kotlin/teksturepako/pakku/api/actions/import/ImportCurseForge.kt b/src/commonMain/kotlin/teksturepako/pakku/api/actions/import/ImportCurseForge.kt index 960f1fe2..7b694044 100644 --- a/src/commonMain/kotlin/teksturepako/pakku/api/actions/import/ImportCurseForge.kt +++ b/src/commonMain/kotlin/teksturepako/pakku/api/actions/import/ImportCurseForge.kt @@ -8,10 +8,13 @@ import teksturepako.pakku.api.actions.ActionError.FileNotFound import teksturepako.pakku.api.data.json import teksturepako.pakku.api.models.ModpackModel import teksturepako.pakku.api.models.cf.CfModpackModel -import teksturepako.pakku.io.readPathTextOrNull import teksturepako.pakku.io.readPathTextFromZip +import teksturepako.pakku.io.readPathTextOrNull import java.nio.file.Path -import kotlin.io.path.* +import kotlin.io.path.exists +import kotlin.io.path.extension +import kotlin.io.path.name +import kotlin.io.path.pathString private fun String?.toCfModpackModel(): ModpackModel? = this?.let { json.decodeFromString(it) } diff --git a/src/commonMain/kotlin/teksturepako/pakku/api/actions/import/ImportModrinth.kt b/src/commonMain/kotlin/teksturepako/pakku/api/actions/import/ImportModrinth.kt index 142dc6eb..9942dac0 100644 --- a/src/commonMain/kotlin/teksturepako/pakku/api/actions/import/ImportModrinth.kt +++ b/src/commonMain/kotlin/teksturepako/pakku/api/actions/import/ImportModrinth.kt @@ -8,9 +8,8 @@ import teksturepako.pakku.api.actions.ActionError.FileNotFound import teksturepako.pakku.api.data.json import teksturepako.pakku.api.models.ModpackModel import teksturepako.pakku.api.models.mr.MrModpackModel -import teksturepako.pakku.io.readPathTextOrNull import teksturepako.pakku.io.readPathTextFromZip -import java.io.File +import teksturepako.pakku.io.readPathTextOrNull import java.nio.file.Path import kotlin.io.path.exists import kotlin.io.path.extension diff --git a/src/commonMain/kotlin/teksturepako/pakku/cli/cmd/Import.kt b/src/commonMain/kotlin/teksturepako/pakku/cli/cmd/Import.kt index 9907e6cb..3b96a94c 100644 --- a/src/commonMain/kotlin/teksturepako/pakku/cli/cmd/Import.kt +++ b/src/commonMain/kotlin/teksturepako/pakku/cli/cmd/Import.kt @@ -3,7 +3,6 @@ package teksturepako.pakku.cli.cmd import com.github.ajalt.clikt.core.CliktCommand import com.github.ajalt.clikt.core.terminal import com.github.ajalt.clikt.parameters.arguments.argument -import com.github.ajalt.clikt.parameters.arguments.optional import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.option import com.github.ajalt.clikt.parameters.types.path