Skip to content

Commit 7161b3a

Browse files
committed
go: allow dependencies without version
Factorio allows a mod to specify a dependency without a version number.
1 parent 637acba commit 7161b3a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/mod_modInfo.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,26 @@ func (modInfoList *ModInfoList) listInstalledMods() error {
8282
}
8383

8484
parts := strings.Split(dep, " ")
85-
if len(parts) != 3 {
85+
if len(parts) > 3 {
8686
log.Printf("skipping dependency '%s' in '%s': invalid format\n", dep, modInfo.Name)
87+
continue
8788
}
8889
if parts[0] != "base" {
8990
continue
9091
}
92+
if len(parts) == 1 {
93+
base = modInfo.FactorioVersion
94+
continue
95+
}
9196

9297
if parts[1] != ">=" {
9398
log.Printf("skipping dependency '%s' in '%s': unsupported comparison\n", dep, modInfo.Name)
99+
continue
94100
}
95101

96102
if err := base.UnmarshalText([]byte(parts[2])); err != nil {
97103
log.Printf("skipping dependency '%s' in '%s': %v\n", dep, modInfo.Name, err)
104+
continue
98105
}
99106

100107
break

0 commit comments

Comments
 (0)