Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 903 Bytes

mod_deps.md

File metadata and controls

29 lines (22 loc) · 903 Bytes

ModParseContext has LoadedDependencyMods modconfig.ModMap

currently keyed by mod name - change to key by full name of locked version

GetLockedModVersionConstraint() FullName()

Usage

  1. loadModDependencies
func loadModDependencies(mod *modconfig.Mod, parseCtx *parse.ModParseContext) error {
    ...
    for _, requiredModVersion := range mod.Require.Mods {
        // if we have a locked version, update the required version to reflect this
        lockedVersion, err := parseCtx.WorkspaceLock.GetLockedModVersionConstraint(requiredModVersion, mod)
        if err != nil {
            errors = append(errors, err)
            continue
        }
        if lockedVersion != nil {
            requiredModVersion = lockedVersion
        }

        // have we already loaded a mod which satisfied this
        if loadedMod, ok := parseCtx.LoadedDependencyMods[requiredModVersion.Name]; ok {