move saving json down since it's done after almost any function
This commit is contained in:
+6
-5
@@ -94,11 +94,6 @@ func main() {
|
|||||||
fmt.Fprintf(os.Stderr, "Error adding URL: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error adding URL: %v\n", err)
|
||||||
os.Exit(1)
|
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":
|
case "remove":
|
||||||
if len(c.Args()) < 1 {
|
if len(c.Args()) < 1 {
|
||||||
fmt.Fprint(os.Stderr, "Please provide a URL to remove.\n\n")
|
fmt.Fprint(os.Stderr, "Please provide a URL to remove.\n\n")
|
||||||
@@ -108,6 +103,12 @@ func main() {
|
|||||||
// TODO
|
// TODO
|
||||||
fmt.Fprintln(os.Stderr, "Not Yet Implemented")
|
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.
|
// verifyPath will expand ~ if neccessary and will clean the path.
|
||||||
|
|||||||
Reference in New Issue
Block a user