From 85d65ebe0adf1b156324a3a4c220e415a79ba9ce Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Wed, 16 Sep 2026 14:13:26 +0200 Subject: gui: Rules tab - the file as text, checked as you type, tested and saved --- internal/config/skel.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/config') 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 { -- cgit v1.3