Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-01-30 11:04:19 +0100
committerErich Eckner <git@eckner.net>2020-01-30 11:04:19 +0100
commit90750bad1b9337731f7ba45b7d4a15544b0e51f6 (patch)
treeac130c36464a0fc7ee1b0232050ea18ccb6a3b6f
parent15bcbb428a3c1b87511c244d32ab628e52e9cd54 (diff)
lib/intentions-queue: intentions_left() new
-rwxr-xr-xlib/intentions-queue19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/intentions-queue b/lib/intentions-queue
index e6c2e25..789d2d5 100755
--- a/lib/intentions-queue
+++ b/lib/intentions-queue
@@ -81,3 +81,22 @@ execute_intention() {
) || return 0
"${intentions_directory}/intention.${next_number}"
}
+
+# intentions_left
+# check if there are undone intentions left
+# return 0 if there is something left to do
+# return 1 if nothing is queued
+intentions_left() {
+ find "${intentions_directory}" \
+ -maxdepth 1 \
+ -type f \
+ -name 'intention.*' \
+ -printf '%f\n' \
+ | sed '
+ s/^intention\.//
+ t
+ d
+ ' \
+ | sort -n \
+ | grep -qxm1 '[0-9]\+'
+}