mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 13:06:30 +02:00
Fix Modrinth exports of external files with omitted side field
This commit is contained in:
parent
f00dc9844f
commit
4f6528dcb5
@ -45,12 +45,12 @@ type ModOption struct {
|
|||||||
Default bool `toml:"default,omitempty"`
|
Default bool `toml:"default,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// The three possible values of Side (the side that the mod is on) are "server", "client", and "both".
|
// The four possible values of Side (the side that the mod is on) are "server", "client", "both", and "" (equivalent to "both")
|
||||||
// noinspection GoUnusedConst
|
|
||||||
const (
|
const (
|
||||||
ServerSide = "server"
|
ServerSide = "server"
|
||||||
ClientSide = "client"
|
ClientSide = "client"
|
||||||
UniversalSide = "both"
|
UniversalSide = "both"
|
||||||
|
EmptySide = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
// LoadMod attempts to load a mod file from a path
|
// LoadMod attempts to load a mod file from a path
|
||||||
|
@ -72,7 +72,7 @@ var exportCmd = &cobra.Command{
|
|||||||
// Filter mods by side
|
// Filter mods by side
|
||||||
// TODO: opt-in optional disabled filtering?
|
// TODO: opt-in optional disabled filtering?
|
||||||
for _, mod := range mods {
|
for _, mod := range mods {
|
||||||
if len(mod.Side) == 0 || mod.Side == side || mod.Side == "both" || side == "both" {
|
if mod.Side == side || mod.Side == core.EmptySide || mod.Side == core.UniversalSide || side == core.UniversalSide {
|
||||||
mods[i] = mod
|
mods[i] = mod
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ var exportCmd = &cobra.Command{
|
|||||||
envInstalled = "required"
|
envInstalled = "required"
|
||||||
}
|
}
|
||||||
var clientEnv, serverEnv string
|
var clientEnv, serverEnv string
|
||||||
if dl.Mod.Side == core.UniversalSide {
|
if dl.Mod.Side == core.UniversalSide || dl.Mod.Side == core.EmptySide {
|
||||||
clientEnv = envInstalled
|
clientEnv = envInstalled
|
||||||
serverEnv = envInstalled
|
serverEnv = envInstalled
|
||||||
} else if dl.Mod.Side == core.ClientSide {
|
} else if dl.Mod.Side == core.ClientSide {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user