]> ruderich.org/simon Gitweb - nsscash/nsscash.git/blobdiff - state.go
.github: update upstream actions to latest version
[nsscash/nsscash.git] / state.go
index 43fc598b1814bc17a92821587a40ed35b697c87a..59c885ae9cf17c9a15a2e980702926a24cf26339 100644 (file)
--- a/state.go
+++ b/state.go
@@ -1,6 +1,6 @@
 // Read and write the state file used to keep data over multiple runs
 
-// Copyright (C) 2019-2020  Simon Ruderich
+// Copyright (C) 2019-2021  Simon Ruderich
 //
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU Affero General Public License as published by
@@ -80,5 +80,9 @@ func WriteState(path string, state *State) error {
        if err != nil {
                return err
        }
-       return f.CloseAtomicallyReplace()
+       err = f.CloseAtomicallyReplace()
+       if err != nil {
+               return err
+       }
+       return syncPath(filepath.Dir(path))
 }