add regenerate command

This commit is contained in:
nytpu
2021-03-20 09:55:51 -06:00
parent fece24eed9
commit d342b6f542
3 changed files with 25 additions and 3 deletions
+12
View File
@@ -67,6 +67,18 @@ func main() {
fmt.Fprintf(os.Stderr, "Error writing feed: %v\n", err)
os.Exit(1)
}
case "regenerate":
argCheck(c.Args(), 0, false, "'regenerate' doesn't take an argument!")
err = core.Data.WriteSubs(dataPath)
if err != nil {
fmt.Fprintf(os.Stderr, "Error writing subscriptions: %v\n", err)
os.Exit(1)
}
err = core.Data.WriteFeed(dataPath)
if err != nil {
fmt.Fprintf(os.Stderr, "Error writing feed: %v\n", err)
os.Exit(1)
}
case "add":
argCheck(c.Args(), 1, true, "Please provide a URL to add.")