mirror of
https://github.com/Tilo-K/ddragon-cdn.git
synced 2026-01-09 16:41:01 +00:00
Fixed ranked emblems and deleting tgz files
This commit is contained in:
12
main.go
12
main.go
@@ -189,7 +189,17 @@ func getCurrentVersion() string {
|
||||
return string(data)
|
||||
}
|
||||
|
||||
func deleteTgz() {
|
||||
files, err := filepath.Glob("ddragon*.tgz")
|
||||
checkError(err)
|
||||
for _, file := range files {
|
||||
fmt.Printf("Deleting %s", file)
|
||||
os.RemoveAll(file)
|
||||
}
|
||||
}
|
||||
|
||||
func loadCurrent() {
|
||||
deleteTgz()
|
||||
storageDir := os.Getenv("STORAGE_DIR")
|
||||
versions := getVersions()
|
||||
if versions == nil {
|
||||
@@ -223,7 +233,7 @@ func loadCurrent() {
|
||||
checkError(err)
|
||||
|
||||
export, _ := filepath.Abs(filepath.Join(storageDir, "data", "ranked-emblems"))
|
||||
err = CopyDirectory(filepath.Join(storageDir, "ranked-emblems"), export)
|
||||
err = CopyDirectory("ranked-emblems", export)
|
||||
checkError(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user