Update loader/mc versions from imported CF packs (fixes #70)

also refactored internal modloader handling!
This commit is contained in:
comp500
2021-11-22 14:44:08 +00:00
parent b628e2762c
commit 96a2d5fdf6
3 changed files with 55 additions and 49 deletions

View File

@@ -166,6 +166,16 @@ var importCmd = &cobra.Command{
},
Versions: packImport.Versions(),
}
} else {
for component, version := range packImport.Versions() {
packVersion, ok := pack.Versions[component]
if !ok {
fmt.Println("Set " + core.ComponentToFriendlyName(component) + " version to " + version)
} else if packVersion != version {
fmt.Println("Set " + core.ComponentToFriendlyName(component) + " version to " + version + " (previously " + version + ")")
}
pack.Versions[component] = version
}
}
index, err := pack.LoadIndex()
if err != nil {