aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2021-04-18 11:09:25 -0300
committerSilvio Rhatto <rhatto@riseup.net>2021-04-18 11:09:25 -0300
commitf6a1ba2d3a49363edb9128fda6e518a22fb82eee (patch)
tree39338c87015d62810da5e5701d36e12854201001
parent561d25be18529a18b9651b01f7ce6814064ada53 (diff)
downloadscripts-f6a1ba2d3a49363edb9128fda6e518a22fb82eee.tar.gz
scripts-f6a1ba2d3a49363edb9128fda6e518a22fb82eee.tar.bz2
Fix: show: watch: subfolder support
-rwxr-xr-xshow11
1 files changed, 9 insertions, 2 deletions
diff --git a/show b/show
index 2815aad..aa8c539 100755
--- a/show
+++ b/show
@@ -12,6 +12,7 @@ LIST="$DOCS/$FILELIST"
DOC_PATTERN=".*\.(txt|doc|docx|rtf|pdf|sxc|csv|odt|odf|ods|xls|xlsx|ppt|epub|mobi|djvu|lit)"
FIND_OPTS="-not -path '*.git*' -regextype posix-egrep -iregex"
ITEM="$1"
+OPTION="$2"
DATE="`date +%s`"
MAX_AGE="86400"
@@ -62,8 +63,14 @@ if [ "$ITEM" == "--search" ]; then
grep -i -- "$*" $LIST
elif [ "$ITEM" == "--watch" ]; then
# Convert symlink to full path and start inotifywait loop
- #while inotifywait -e modify -e create -e move -e delete -r "`readlink -f $DOCS`"; do
- while inotifywait -e modify -e move -r "`readlink -f $DOCS`"; do
+ folder="`readlink -f $DOCS`"
+ subfolder="$OPTION"
+ echo "Watching changes at $folder/$subfolder..."
+
+ #while inotifywait -e modify -e create -e move -e delete -r "$folder"; do
+ #while inotifywait -e modify -e move -r "$folder"; do
+ #while inotifywait -e modify -e move -r "$folder/$subfolder"; do
+ while inotifywait -e modify -e create -e move -e delete -r "$folder/$subfolder"; do
$PROGRAM --refresh
done
else