mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 13:06:30 +02:00
Allow jars/txt files in mods folder
This commit is contained in:
parent
2ac050a25b
commit
d6076dba5e
@ -137,15 +137,12 @@ func (in *Index) updateFile(path string) error {
|
|||||||
hashString := hex.EncodeToString(h.Sum(nil))
|
hashString := hex.EncodeToString(h.Sum(nil))
|
||||||
|
|
||||||
mod := false
|
mod := false
|
||||||
// If the file is in the mods folder, set MetaFile to true (mods are metafiles by default)
|
// If the file has an extension of toml and is in the mods folder, set mod to true
|
||||||
// This is incredibly powerful: you can put a normal jar in the mods folder just by
|
|
||||||
// setting MetaFile to false. Or you can use the "mod" metadata system for other types
|
|
||||||
// of files, like CraftTweaker resources.
|
|
||||||
absFileDir, err := filepath.Abs(filepath.Dir(path))
|
absFileDir, err := filepath.Abs(filepath.Dir(path))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
absModsDir, err := filepath.Abs(viper.GetString("mods-folder"))
|
absModsDir, err := filepath.Abs(viper.GetString("mods-folder"))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if absFileDir == absModsDir {
|
if absFileDir == absModsDir && strings.HasSuffix(filepath.Base(path), ".toml") {
|
||||||
mod = true
|
mod = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user