Command to open page in browser; refactoring

This commit is contained in:
comp500
2019-06-14 22:35:34 +01:00
parent ebc2115b41
commit 91693cd3eb
6 changed files with 208 additions and 159 deletions

View File

@@ -1,4 +1,5 @@
package core
import (
"path/filepath"
"strings"
@@ -9,7 +10,7 @@ const ModExtension = ".toml"
// ResolveMod returns the path to a mod file from it's name
func ResolveMod(modName string, flags Flags) string {
// TODO: should this work for any metadata file?
fileName := strings.ToLower(strings.TrimSuffix(modName, ModExtension)) + ModExtension
return filepath.Join(flags.ModsFolder, fileName)
}