From de0b6603e34612dd4bef8cc83c71fddb477e7b35 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 20 Nov 2025 12:25:43 -1000 Subject: [PATCH] ;bin: hledger-check-buynothing --- bin/README.md | 5 +++++ bin/hledger-check-buynothing | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 bin/hledger-check-buynothing diff --git a/bin/README.md b/bin/README.md index 12072bd91..f15ddd8ba 100644 --- a/bin/README.md +++ b/bin/README.md @@ -280,6 +280,11 @@ $ hledger bar -v 1 -f $TIMELOG -D # daily hours, with numbers ``` (or with hledger <1.50: `hledger bar -- ...`) +### hledger-check-buynothing + +[`hledger-check-buynothing`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-check-buynothing) +checks for no activity in Expense accounts on Buy Nothing Day (or other period). + ### hledger-git [`hledger-git`](https://github.com/simonmichael/hledger/blob/master/bin/hledger-git) diff --git a/bin/hledger-check-buynothing b/bin/hledger-check-buynothing new file mode 100755 index 000000000..148fec498 --- /dev/null +++ b/bin/hledger-check-buynothing @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# hledger check-buynothing [-p PERIOD] [OTHERHLEDGERARGS] +# Check for no activity in Expense accounts on Buy Nothing Day (November 28th). +# +# You can specify a different date or period with -p. +# You can add other options/arguments to refine the query. + +txns=$(hledger reg type:x -p 11/28 "$@") +if [[ ! "$txns" == "" ]] +then + echo "Buy Nothing failure!" + echo "$txns" + exit 1 +fi