mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-21 00:54:31 +02:00
Use the correct directories for non-mod files; use .pw.toml extension
The mods-folder option is now replaced with two new options: meta-folder and meta-folder-base This allows non-mod files to use the correct directory based on their category; with correct import of resource packs/etc from CurseForge packs, and the ability to override this behaviour. To improve the reliability of packwiz metadata file marking (in the index), new files now use .pw.toml as the extension - any extension can be used, but .pw.toml will now be automatically be marked as a metafile regardless of folder, so you can easily move metadata files around. Existing metadata files will still work (as metafile = true is set in the index); though in the future .pw.toml may be required.
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/spf13/viper"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
@@ -207,10 +208,14 @@ func installVersion(mod Mod, version Version, pack core.Pack) error {
|
||||
Update: updateMap,
|
||||
}
|
||||
var path string
|
||||
folder := viper.GetString("meta-folder")
|
||||
if folder == "" {
|
||||
folder = "mods"
|
||||
}
|
||||
if mod.Slug != "" {
|
||||
path = modMeta.SetMetaName(mod.Slug, index)
|
||||
path = modMeta.SetMetaPath(filepath.Join(viper.GetString("meta-folder-base"), folder, mod.Slug+core.MetaExtension))
|
||||
} else {
|
||||
path = modMeta.SetMetaName(mod.Title, index)
|
||||
path = modMeta.SetMetaPath(filepath.Join(viper.GetString("meta-folder-base"), folder, mod.Title+core.MetaExtension))
|
||||
}
|
||||
|
||||
// If the file already exists, this will overwrite it!!!
|
||||
|
Reference in New Issue
Block a user