diff options
Diffstat (limited to 'lass/5pkgs/bank/default.nix')
-rw-r--r-- | lass/5pkgs/bank/default.nix | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lass/5pkgs/bank/default.nix b/lass/5pkgs/bank/default.nix new file mode 100644 index 000000000..9f3a44d79 --- /dev/null +++ b/lass/5pkgs/bank/default.nix @@ -0,0 +1,14 @@ +{ writeDashBin, coreutils, pass, hledger, diffutils }: + +writeDashBin "bank" '' + tmp=$(mktemp) + ${pass}/bin/pass show hledger > $tmp + ${hledger}/bin/hledger --file=$tmp "$@" + ${pass}/bin/pass show hledger | if ${diffutils}/bin/diff $tmp -; then + exit 0 + else + ${coreutils}/bin/cat $tmp | ${pass}/bin/pass insert -m hledger + fi + ${coreutils}/bin/rm $tmp +'' + |