TheMathemagicians/sevenkeys/cmd/importsets/main.go

26 lines
400 B
Go
Raw Normal View History

2024-05-20 16:17:45 +00:00
package main
import (
"log"
"sevenkeys/database"
"sevenkeys/database/operations"
"sevenkeys/scryfall/methods"
)
func check(err error) {
if err != nil {
log.Fatal(err)
}
}
func main() {
sets, err := methods.GetSets()
check(err)
db := database.GetDatabaseFromConfig("config.json")
err = operations.InsertOrUpdateSets(db, sets)
check(err)
// Download icon files to cache/ directory
}