Removed the entire save data logic as its unnecessary
All checks were successful
/ publish (push) Successful in 1m40s
All checks were successful
/ publish (push) Successful in 1m40s
This commit is contained in:
parent
d411667a3e
commit
8bd3474c4b
3 changed files with 1 additions and 40 deletions
|
|
@ -15,9 +15,7 @@ import (
|
|||
|
||||
func main() {
|
||||
headerImages := flag.String("i", "data/pending-header-images.json", "header images json file")
|
||||
currentPendingImage := flag.String("curr-image-data", "", "current header image URL")
|
||||
targetFile := flag.String("o", "out.jpg", "target file")
|
||||
odFile := flag.String("out-data", "out-data.json", "target file data")
|
||||
flag.Parse()
|
||||
|
||||
pis, err := LoadPendingImages(*headerImages)
|
||||
|
|
@ -32,17 +30,6 @@ func main() {
|
|||
}
|
||||
log.Printf("found pending image: %s\n", pi.URL)
|
||||
|
||||
if *currentPendingImage != "" {
|
||||
if cpi, err := LoadPendingImageFromURL(*currentPendingImage); err == nil {
|
||||
if pi.URL == cpi.URL {
|
||||
log.Println("current pending image is already the latest")
|
||||
return
|
||||
}
|
||||
} else {
|
||||
log.Printf("warn: failed to load current pending image: %s\n", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := fetchHeaderImageFromURL(*targetFile, pi); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
@ -52,10 +39,6 @@ func main() {
|
|||
if err := json.NewEncoder(&dBfr).Encode(pi); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if err := os.WriteFile(*odFile, dBfr.Bytes(), 0644); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func fetchHeaderImageFromURL(outFile string, pi PendingImage) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue