Fix lookup of old .toml files

This commit is contained in:
comp500 2022-05-21 14:29:59 +01:00
parent fc3b5ff8ea
commit bf2f060efc
2 changed files with 3 additions and 1 deletions

View File

@ -335,7 +335,7 @@ func (in Index) FindMod(modName string) (string, bool) {
for _, v := range in.Files {
if v.MetaFile {
_, file := filepath.Split(v.File)
fileTrimmed := strings.TrimSuffix(file, MetaExtension)
fileTrimmed := strings.TrimSuffix(strings.TrimSuffix(file, MetaExtension), MetaExtensionOld)
if fileTrimmed == modName {
return filepath.Join(filepath.Dir(in.indexFile), filepath.FromSlash(v.File)), true
}

View File

@ -3,3 +3,5 @@ package core
// MetaExtension is the file extension of the mod metadata files
// Note that this is currently not required; it will only be used for new files.
const MetaExtension = ".pw.toml"
const MetaExtensionOld = ".toml"