mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-14 06:54:32 +02:00
Add pack-root option (fixes #27)
This commit is contained in:
@@ -187,7 +187,7 @@ func createModFile(modInfo modInfo, fileInfo modFileInfo, index *core.Index) err
|
||||
},
|
||||
Update: updateMap,
|
||||
}
|
||||
path := modMeta.SetMetaName(modInfo.Slug)
|
||||
path := modMeta.SetMetaName(modInfo.Slug, *index)
|
||||
|
||||
// If the file already exists, this will overwrite it!!!
|
||||
// TODO: Should this be improved?
|
||||
|
@@ -224,7 +224,8 @@ var importCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
// TODO: just use mods-folder directly? does texture pack importing affect this?
|
||||
ref, err := filepath.Abs(filepath.Join(filepath.Dir(core.ResolveMod(modInfoValue.Slug)), fileInfo.FileName))
|
||||
modFilePath := core.ResolveMod(modInfoValue.Slug, index)
|
||||
ref, err := filepath.Abs(filepath.Join(filepath.Dir(modFilePath), fileInfo.FileName))
|
||||
if err == nil {
|
||||
referencedModPaths = append(referencedModPaths, ref)
|
||||
}
|
||||
@@ -243,9 +244,9 @@ var importCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
successes = 0
|
||||
indexFolder := filepath.Dir(filepath.Join(filepath.Dir(viper.GetString("pack-file")), filepath.FromSlash(pack.Index.File)))
|
||||
packRoot := index.GetPackRoot()
|
||||
for _, v := range filesList {
|
||||
filePath := filepath.Join(indexFolder, filepath.FromSlash(v.Name()))
|
||||
filePath := filepath.Join(packRoot, filepath.FromSlash(v.Name()))
|
||||
filePathAbs, err := filepath.Abs(filePath)
|
||||
if err == nil {
|
||||
found := false
|
||||
|
Reference in New Issue
Block a user