add skip download

This commit is contained in:
2025-07-20 21:13:07 -07:00
parent 54cc1d9a55
commit 6b6dbdda99
2 changed files with 28 additions and 26 deletions

View File

@ -49,7 +49,7 @@ func main() {
log.Fatalf("WowDir in %s is still the default setting, exiting", cfgPath) log.Fatalf("WowDir in %s is still the default setting, exiting", cfgPath)
} }
stats, err := epoch.DownloadUpdate(config.WowDir, forceFlag, config.RemoveUnknownPatches) stats, err := epoch.Update(config.WowDir, forceFlag, config.RemoveUnknownPatches, false)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@ -19,7 +19,7 @@ type DownloadStats struct {
Current int Current int
} }
func DownloadUpdate(wowdir string, force bool, removeUnknown bool) (DownloadStats, error) { func Update(wowdir string, force bool, removeUnknown bool, skipDownload bool) (DownloadStats, error) {
var stats DownloadStats var stats DownloadStats
manifest, err := GetManifest() manifest, err := GetManifest()
@ -56,6 +56,7 @@ func DownloadUpdate(wowdir string, force bool, removeUnknown bool) (DownloadStat
} }
} }
if !skipDownload {
fmt.Printf("Updating %s...\n", localPath) fmt.Printf("Updating %s...\n", localPath)
outFile, err := os.Create(localPath) outFile, err := os.Create(localPath)
@ -87,6 +88,7 @@ func DownloadUpdate(wowdir string, force bool, removeUnknown bool) (DownloadStat
outFile.Close() outFile.Close()
stats.Updated += 1 stats.Updated += 1
} }
}
if removeUnknown { if removeUnknown {
patches := make([]string, 0) patches := make([]string, 0)