-
-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support stdin journal (web), create journal file if not exists (ui, web) #978
Conversation
I forgot to mention - it it possible to implement this without touching hledger-lib or hledger, but there would be a bit more special-casing required. Looking back, I'm not sure about the |
Completing /edit and /upload would also be a good step that I'd wanted to implement but ran out of time yesterday. I'm not sure if I should continue in this PR (and mark this one as WIP) or open another one later. |
Oh, and also - the exceptions ("handle is already closed") were caused by the check in |
Thanks, I'll take a look asap.
|
3a77cc9
to
cf94720
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh.. maybe I did't submit this review...
817b2c6
to
5cebaa4
Compare
Sorry for the many force-pushes, I've been doing the changes one line at a time. I've rebased the commit and addressed the change requests, I think. I'd like to implement in-memory parts of /edit and /upload as well, please don't merge this until then. |
5cebaa4
to
147a179
Compare
147a179
to
82642b4
Compare
Now also closes #950. I've split the PR into two commits, one adding support for stdin to hledger-web, the other creating non-existent journals on startup. I've also added the missing /edit and /upload parts - now all of hledger-web supports stdin journals, and also filled in the missing |
Sorry for the delay on this.
|
Related: in what situations does hledger do that already ? I think only hledger add, right ? |
Hi @zarybnicky, any thoughts on this ? It says I requested a change, I guess that was to remove/postpone the auto-create-missing-journal-file functionality. |
Oops, it seems I'd managed to archive the GitHub mail that has served as my reminder for this issue... I'll try to look it over tomorrow and see where it's at. |
Ping |
Wow, I've been terrible regarding this PR. Real life stuff does that, sorry... I'll close this PR and open two separate ones instead |
Closes #855. The hledger-web half of #950.
This also fixes some oversights regarding
"-"
journal files in hledger-lib andhledger (some, not all).
The behavior with
-f -
is currently the following: the journal is loaded intomemory, and any /add commands append to the in-memory journal. /edit doesn't do
anything yet as
readJournalFiles
usesreadFileOrStdinPortably
and assumesthe file is either
-
or a file, so there's some postprocessing (filters, anon,...) that would need to be reimplemented.
The #950 part is just using
ensureJournalFileExists
in place ofrequireJournalFileExists
.