Skip to content

If I delete a file in a 1-in directory, re-running hledger-flow import does not remove the corresponding files in the 2-preprocessed and 3-journal directories #108

@jfly

Description

@jfly

First off, thanks for a wonderful tool!

Describe the bug
If I delete a file in a 1-in directory, re-running hledger-flow import does not remove the corresponding files in the 2-preprocessed and 3-journal directories.

Version and Runtime Information

Please mention the version number of hledger-flow you are using:

$ hledger-flow --version
hledger-flow 0.14.4 linux x86_64 ghc 9.0 UNKNOWN

I know this is not the latest version of hledger-flow, sorry. I looked at the diff between 0.14.4 and 0.15, and I don't think anything related to this has been changed. Let me know if it's really important to test with the latest version of hledger-flow, and I'll figure out how to update.

Also include the runtime options of the command you ran, e.g:

$ hledger-flow --show-options import

To Reproduce

I can reproduce this with a fresh clone of https://github.com/apauley/hledger-flow-example:

$ rm import/gawie/bogart/cheque/1-in/2016/123456789_2016-03-30.csv

$ hledger-flow import . --show-options
RuntimeOptions {baseDir = "/home/jeremy/src/github.com/apauley/hledger-flow-example/", importRunDir = "./", importStartYear = Nothing, onlyNewFiles = False, hfVersion = "hledger-flow 0.14.4 linux x86_64 ghc 9.0 UNKNOWN", hledgerInfo = HledgerInfo {hlPath = "/nix/store/lxv7a7ps6k7girbwm50kr3w42ih90v8w-hledger-1.25/bin/hledger", hlVersion = "hledger 1.25, linux-x86_64"}, sysInfo = SystemInfo {os = "linux", arch = "x86_64", compilerName = "ghc", compilerVersion = Version {versionBranch = [9,0], versionTags = []}, cores = 4, availableCores = 4}, verbose = False, showOptions = True, sequential = False, batchSize = 200}
Collecting input files from /home/jeremy/src/github.com/apauley/hledger-flow-example/import/
Found 2 input files in 0.001297681s. Proceeding with import...
Wrote include files for 3 journals in 0.002288837s
Imported 2/2 journals in 0.061123857s

$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	deleted:    import/gawie/bogart/cheque/1-in/2016/123456789_2016-03-30.csv

no changes added to commit (use "git add" and/or "git commit -a")

Expected behavior

In the example above, I'd expect import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-03-30.csv and import/gawie/bogart/cheque/3-journal/2016/123456789_2016-03-30.journal to get deleted as well.

For now, I am working around this by first nuking my 2-preprocessed and 3-journal directories before doing an import:

$ rm -r import/*/*/*/2-preprocessed import/*/*/*/3-journal
$ hledger-flow import .

Desktop (please complete the following information):
I'm running Arch Linux. I installed hledger and hledger-flow with the Nix package manager.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions