diff options
| author | nytpu <alex@nytpu.com> | 2021-03-18 16:28:02 -0600 |
|---|---|---|
| committer | nytpu <alex@nytpu.com> | 2021-03-18 16:28:02 -0600 |
| commit | b4d303e24ef7c16ff9ba6bdeab704783040a770e (patch) | |
| tree | e8c7c2c538fcea9ae8be632737edd3487f04c649 /comitium.go | |
| parent | c3f5f7c68245f7f2d50a49be3e75c12af972ed8d (diff) | |
Write subscriptions
Diffstat (limited to 'comitium.go')
| -rw-r--r-- | comitium.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/comitium.go b/comitium.go index 8e9c003..1dc25d8 100644 --- a/comitium.go +++ b/comitium.go @@ -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) } } |
