mirror of
https://github.com/packwiz/packwiz.git
synced 2025-11-19 01:24:32 +01:00
Add pack-root option (fixes #27)
This commit is contained in:
@@ -11,8 +11,9 @@ import (
|
||||
const ModExtension = ".toml"
|
||||
|
||||
// ResolveMod returns the path to a mod file from it's name
|
||||
func ResolveMod(modName string) string {
|
||||
func ResolveMod(modName string, index Index) string {
|
||||
// TODO: should this work for any metadata file?
|
||||
fileName := strings.ToLower(strings.TrimSuffix(modName, ModExtension)) + ModExtension
|
||||
return filepath.Join(viper.GetString("mods-folder"), fileName)
|
||||
modsDir := filepath.Join(index.GetPackRoot(), viper.GetString("mods-folder"))
|
||||
return filepath.Join(modsDir, fileName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user