diff --git a/README.md b/README.md index 3d84c38..f0b2bf3 100644 --- a/README.md +++ b/README.md @@ -1 +1,12 @@ # Journal + +## What is this? + +Simplest possible (well, choose your own definition of "simplest") journalling system. + +Run it, it drops you into an editor which lets you write. Ctrl+S to save, Ctrl+C to save +and quit. + +## Install + + go install code.ppl.town/justin/journal@latest \ No newline at end of file diff --git a/main.go b/main.go index 5fa781d..91484cc 100644 --- a/main.go +++ b/main.go @@ -33,6 +33,7 @@ type transientMsg struct { type WriteSeekCloser interface { io.WriteSeeker io.Closer + Sync() error } type model struct { @@ -173,7 +174,8 @@ func (m model) writeFile() error { if err != nil { return fmt.Errorf("write: %w", err) } - return nil + + return m.fh.Sync() } func (m model) View() tea.View {