Skip to content

Commit

Permalink
Fix resource packs being exported in server pack
Browse files Browse the repository at this point in the history
  • Loading branch information
juraj-hrivnak committed Aug 8, 2024
1 parent fc35707 commit 57ba8e6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/commonMain/kotlin/teksturepako/pakku/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CfModpackModel>(it) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/commonMain/kotlin/teksturepako/pakku/cli/cmd/Import.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 57ba8e6

Please sign in to comment.