index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | lib/intentions-queue | 19 |
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]\+' +} |