aboutsummaryrefslogtreecommitdiff
path: root/internal/config/skel.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/skel.go')
-rw-r--r--internal/config/skel.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/config/skel.go b/internal/config/skel.go
index 2e54894..e0d7dd8 100644
--- a/internal/config/skel.go
+++ b/internal/config/skel.go
@@ -165,6 +165,12 @@ func writeNew(path string, data []byte) error {
return f.Close()
}
+// Replace atomically replaces the file at path with data, keeping its
+// permissions and following a symlink to its target - what krino new does
+// when it rewrites krino.conf. The GUI's rules editor saves through it, so
+// there is one way krino writes a configuration file (GUI design ยง5.3).
+func Replace(path string, data []byte) error { return replaceFile(path, data) }
+
// replaceFile atomically replaces the file at path, keeping its permissions.
// A symlink is followed and its target replaced, so dotfile links survive.
func replaceFile(path string, data []byte) error {