Write subscriptions
This commit is contained in:
+11
-1
@@ -57,6 +57,11 @@ func main() {
|
||||
case "refresh":
|
||||
argCheck(c.Args(), 0, false, "'refresh' doesn't take an argument!")
|
||||
fetch.RefreshAll(&core.Data, *refreshWorkersFlag)
|
||||
err = core.Data.WriteSubs(dataPath)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error saving subscriptions: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
case "list":
|
||||
argCheck(c.Args(), 0, false, "'list' doesn't take an argument!")
|
||||
core.Data.Export(os.Stdout)
|
||||
@@ -78,6 +83,11 @@ func main() {
|
||||
fmt.Fprintf(os.Stderr, "Error adding URL: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
err = core.Data.WriteSubs(dataPath)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error saving subscriptions: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
case "remove":
|
||||
argCheck(c.Args(), 1, true, "Please provide a URL to remove.")
|
||||
delete(core.Data.Feeds, c.Arg(0))
|
||||
@@ -86,7 +96,7 @@ func main() {
|
||||
|
||||
err = core.Data.WriteJSON(dataPath)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error saving subscriptions: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Error saving subscriptions json: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user