Skip to content

Commit 2140a9f

Browse files
committed
fix: store target in cache filename
1 parent da61008 commit 2140a9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cli/installations.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ func (i *Installation) Install(ctx *GlobalContext, updates chan<- InstallUpdate)
483483

484484
// Only install if a link is provided, otherwise assume mod is already installed
485485
if target.Link != "" {
486-
err := downloadAndExtractMod(modReference, version.Version, target.Link, target.Hash, modsDirectory, updates, downloadSemaphore, d)
486+
err := downloadAndExtractMod(modReference, version.Version, target.Link, target.Hash, platform.TargetName, modsDirectory, updates, downloadSemaphore, d)
487487
if err != nil {
488488
return fmt.Errorf("failed to install %s@%s: %w", modReference, version.Version, err)
489489
}
@@ -560,7 +560,7 @@ func (i *Installation) UpdateMods(ctx *GlobalContext, mods []string) error {
560560
return nil
561561
}
562562

563-
func downloadAndExtractMod(modReference string, version string, link string, hash string, modsDirectory string, updates chan<- InstallUpdate, downloadSemaphore chan int, d disk.Disk) error {
563+
func downloadAndExtractMod(modReference string, version string, link string, hash string, target string, modsDirectory string, updates chan<- InstallUpdate, downloadSemaphore chan int, d disk.Disk) error {
564564
var downloadUpdates chan utils.GenericProgress
565565

566566
var wg sync.WaitGroup
@@ -585,7 +585,7 @@ func downloadAndExtractMod(modReference string, version string, link string, has
585585
}
586586

587587
slog.Info("downloading mod", slog.String("mod_reference", modReference), slog.String("version", version), slog.String("link", link))
588-
reader, size, err := cache.DownloadOrCache(modReference+"_"+version+".zip", hash, link, downloadUpdates, downloadSemaphore)
588+
reader, size, err := cache.DownloadOrCache(modReference+"_"+version+"_"+target+".zip", hash, link, downloadUpdates, downloadSemaphore)
589589
if err != nil {
590590
return fmt.Errorf("failed to download %s from: %s: %w", modReference, link, err)
591591
}

0 commit comments

Comments
 (0)