aboutsummaryrefslogtreecommitdiff
path: root/internal/config/skel.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-16 14:13:26 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-16 14:13:26 +0200
commit85d65ebe0adf1b156324a3a4c220e415a79ba9ce (patch)
tree4e648edce13cbc370e2685475944cafc2236f44a /internal/config/skel.go
parent6ef83d6bdfb6120f9e1fbd145e0bc463196103d1 (diff)
downloadkrino-85d65ebe0adf1b156324a3a4c220e415a79ba9ce.tar.gz
krino-85d65ebe0adf1b156324a3a4c220e415a79ba9ce.zip
gui: Rules tab - the file as text, checked as you type, tested and saved
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 {