aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-06-15 22:33:22 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2017-06-15 22:43:15 -0400
commitc65d21ae38bdfb646af991a5f3b1dfe8e41a5318 (patch)
tree4012d43fe3089a007064788b8b29583c32de92c4
parent9e4ae57ab160241ab0521177b570096089742780 (diff)
downloadcbt-c65d21ae38bdfb646af991a5f3b1dfe8e41a5318.tar.gz
cbt-c65d21ae38bdfb646af991a5f3b1dfe8e41a5318.tar.bz2
cbt-c65d21ae38bdfb646af991a5f3b1dfe8e41a5318.zip
warn on empty loop file (as seen) and sort loop files for debugging
-rwxr-xr-xcbt7
1 files changed, 6 insertions, 1 deletions
diff --git a/cbt b/cbt
index 0a5d4f0..4a5b736 100755
--- a/cbt
+++ b/cbt
@@ -315,11 +315,16 @@ while true; do
done
files=
if [ -f "$CBT_LOOP_FILE" ]; then
- files=($(cat "$CBT_LOOP_FILE"))
+ files=($(sort "$CBT_LOOP_FILE"))
#rm "$CBT_LOOP_FILE"
fi
echo ""
echo "Watching for file changes... (ctrl+c short press for loop, long press for abort)"
+ for file in "${files[@]}"; do
+ if [ $file == "" ]; then
+ echo "warning: empty file found in loop file list" 1>&2
+ fi
+ done
fswatch --one-event "${files[@]}"
fi
done