summaryrefslogtreecommitdiff
path: root/comitium.go
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-03-18 13:33:31 -0600
committernytpu <alex@nytpu.com>2021-03-18 13:33:31 -0600
commit6f2f4ac4b18643f2160c41db08eb8208a14bc9fc (patch)
tree3597ead8bd45191347d1146ab2f246074760a647 /comitium.go
parentf8601b82abe77e19fbe0c97a21f00540da39ac9f (diff)
move saving json down since it's done after almost any function
Diffstat (limited to 'comitium.go')
-rw-r--r--comitium.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/comitium.go b/comitium.go
index 91d7128..3c092d1 100644
--- a/comitium.go
+++ b/comitium.go
@@ -94,11 +94,6 @@ func main() {
fmt.Fprintf(os.Stderr, "Error adding URL: %v\n", err)
os.Exit(1)
}
- err = core.Data.WriteJSON(dataPath)
- if err != nil {
- fmt.Fprintf(os.Stderr, "Error saving subscriptions: %v\n", err)
- os.Exit(1)
- }
case "remove":
if len(c.Args()) < 1 {
fmt.Fprint(os.Stderr, "Please provide a URL to remove.\n\n")
@@ -108,6 +103,12 @@ func main() {
// TODO
fmt.Fprintln(os.Stderr, "Not Yet Implemented")
}
+
+ err = core.Data.WriteJSON(dataPath)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "Error saving subscriptions: %v\n", err)
+ os.Exit(1)
+ }
}
// verifyPath will expand ~ if neccessary and will clean the path.