gcd_downloader/cmd.go
2023-10-23 19:44:24 -07:00

27 lines
471 B
Go

//go:build !gokrazy
package main
import (
"flag"
"log"
"os"
)
func main() {
flag.Parse()
if os.Getenv("GCD_USERNAME") == "" || os.Getenv("GCD_PASSWORD") == "" {
log.Println("Username and password not provided")
os.Exit(0)
}
createDirs()
lastUpdate := getLatestDate()
if shouldUpdate(lastUpdate) {
download(lastUpdate)
log.Println("update complete, waiting 1h to check again")
} else {
log.Println("It's too early, waiting 1h to check again")
}
}