Commit some stuff

This commit is contained in:
comp500
2019-04-25 18:10:23 +01:00
parent a531e36713
commit d6b55b8032
5 changed files with 98 additions and 20 deletions

View File

@@ -13,3 +13,15 @@ func ResolveMod(modName string, flags Flags) string {
return filepath.Join(flags.ModsFolder, fileName)
}
// ResolveIndex returns the path to the index file
func ResolveIndex(flags Flags) (string, error) {
pack, err := LoadPack(flags)
if err != nil {
return "", err
}
if filepath.IsAbs(pack.Index.File) {
return pack.Index.File, nil
}
return filepath.Join(flags.PackFile, pack.Index.File), nil
}