package main import ( "fmt" "sevenkeys/database" "sevenkeys/logic" "sevenkeys/logic/scryfall" "github.com/inancgumus/screen" ) func main() { db := database.GetDatabaseFromConfig("config.json") fmt.Println("Checking for updates...") bulkData, err := scryfall.GetBulkDataByType(scryfall.BulkDataTypeAllCards) logic.Check(err) needsUpdate, err := logic.CheckForUpdates(db, bulkData) logic.Check(err) if needsUpdate { fmt.Println("Update required.") if logic.ConfirmUpdate() { fmt.Println("Running update...") logic.CreateCacheDirectories() err = logic.UpdateSets(db) logic.Check(err) err = logic.UpdateCards(db, bulkData) logic.Check(err) } fmt.Println("Update finished.") } else { fmt.Println("No update required.") } //storageLocation := logic.GetStorageLocation() for { screen.Clear() screen.MoveTopLeft() } }