stockholm/lass/5pkgs/bank/default.nix

15 lines
369 B
Nix
Raw Normal View History

2019-10-14 13:51:14 +00:00
{ 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
''