add skip download
This commit is contained in:
2
main.go
2
main.go
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
Reference in New Issue
Block a user