summaryrefslogtreecommitdiff
path: root/lib/intentions-queue
diff options
context:
space:
mode:
Diffstat (limited to 'lib/intentions-queue')
-rwxr-xr-xlib/intentions-queue14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/intentions-queue b/lib/intentions-queue
index c92a4d1..802d1ca 100755
--- a/lib/intentions-queue
+++ b/lib/intentions-queue
@@ -2,7 +2,7 @@
# contains functions related to the intentions-queue
-# shellcheck disable=SC2039
+# shellcheck disable=SC2039,SC3043
if [ -z "${base_dir}" ]; then
# just to make shellcheck happy
@@ -15,7 +15,7 @@ fi
# $package_database_lock_file externally
intent_something() {
local next_number
- if [ "x$1" = 'x-n' ]; then
+ if [ "$1" = '-n' ]; then
cat
return
fi
@@ -75,7 +75,7 @@ execute_intention() {
# with -n: return immediately
# without -n: wait until nothing more to do
intentions_left() {
- if [ ! "x$1" = 'x-n' ]; then
+ if [ ! "$1" = '-n' ]; then
while intentions_left -n; do
sleep 1
done
@@ -85,13 +85,7 @@ intentions_left() {
-type f \
-name 'intention.*' \
-printf '%f\n' \
- | sed '
- s/^intention\.//
- t
- d
- ' \
- | sort -n \
- | grep -qxm1 '[0-9]\+'
+ | grep -qxm1 'intention\.[0-9]\+'
}
# execute_all_intentions