Skip to content

Commit 868b3a3

Browse files
committed
bugfix: optional dependencies && missing basemod
1 parent 8957101 commit 868b3a3

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

src/mod_modInfo.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,21 @@ func (modInfoList *ModInfoList) listInstalledMods() error {
7474

7575
modInfo.FileName = info.Name()
7676

77-
baseDependency := strings.Split(modInfo.Dependencies[0], "=")[1]
78-
modInfo.Compatibility, err = checkModCompatibility(baseDependency)
79-
if err != nil {
80-
log.Printf("error checking mod compatibility: %s", err)
81-
return err
77+
var baseDependency string
78+
for _, dependency := range modInfo.Dependencies {
79+
if strings.HasPrefix(dependency, "base") {
80+
baseDependency = strings.Split(dependency, "=")[1]
81+
break
82+
}
83+
}
84+
if baseDependency != "" {
85+
modInfo.Compatibility, err = checkModCompatibility(baseDependency)
86+
if err != nil {
87+
log.Printf("error checking mod compatibility: %s", err)
88+
return err
89+
}
90+
} else {
91+
modInfo.Compatibility = true
8292
}
8393

8494
modInfoList.Mods = append(modInfoList.Mods, modInfo)

0 commit comments

Comments
 (0)