]> ruderich.org/simon Gitweb - nsscash/nsscash.git/blobdiff - main.go
nsscash: write state on each successful run
[nsscash/nsscash.git] / main.go
diff --git a/main.go b/main.go
index b10f57e55b92776a18ff5dfa76fb7ed25cc5b39c..52727408962b0030baef955f4c679131e32ad734 100644 (file)
--- a/main.go
+++ b/main.go
@@ -61,7 +61,9 @@ func main() {
                if err != nil {
                        log.Fatal(err)
                }
-               err = WriteStateIfChanged(cfg.StatePath, state)
+               // NOTE: Make sure to call WriteState() only if there were no
+               // errors (see WriteState() and README)
+               err = WriteState(cfg.StatePath, state)
                if err != nil {
                        log.Fatal(err)
                }