From 4d086834fb8cd99b961ba886fb46ab67e7fcf18b Mon Sep 17 00:00:00 2001 From: Tero Niemi Date: Tue, 3 Mar 2020 15:34:35 +0200 Subject: [PATCH 1/2] Fixed the broken -e command line option In the original the defaults always overwrote the option. --- gitwatch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitwatch.sh b/gitwatch.sh index 832b618..689eecf 100755 --- a/gitwatch.sh +++ b/gitwatch.sh @@ -38,6 +38,7 @@ REMOTE="" BRANCH="" SLEEP_TIME=2 +EVENTS="close_write,move,delete,create" DATE_FMT="+%Y-%m-%d %H:%M:%S" COMMITMSG="Scripted auto-commit on change (%d) by gitwatch.sh" LISTCHANGES=-1 @@ -156,7 +157,6 @@ if [ -z "$GW_INW_BIN" ]; then # if Mac, use fswatch if [ "$(uname)" != "Darwin" ]; then INW="inotifywait"; - EVENTS="close_write,move,delete,create"; else INW="fswatch"; # default events specified via a mask, see From 493dd0a38a7dbac42a4fecf123562117b0b08b1c Mon Sep 17 00:00:00 2001 From: Tero Niemi Date: Wed, 4 Mar 2020 13:30:36 +0200 Subject: [PATCH 2/2] Fixing EVENTS also in the Darvin side. Using VAR="${VAR:-defaults}" structure. --- gitwatch.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitwatch.sh b/gitwatch.sh index 689eecf..c503d47 100755 --- a/gitwatch.sh +++ b/gitwatch.sh @@ -38,7 +38,6 @@ REMOTE="" BRANCH="" SLEEP_TIME=2 -EVENTS="close_write,move,delete,create" DATE_FMT="+%Y-%m-%d %H:%M:%S" COMMITMSG="Scripted auto-commit on change (%d) by gitwatch.sh" LISTCHANGES=-1 @@ -157,13 +156,14 @@ if [ -z "$GW_INW_BIN" ]; then # if Mac, use fswatch if [ "$(uname)" != "Darwin" ]; then INW="inotifywait"; + EVENTS="${EVENTS:-close_write,move,delete,create}" else INW="fswatch"; # default events specified via a mask, see # https://emcrisostomo.github.io/fswatch/doc/1.14.0/fswatch.html/Invoking-fswatch.html#Numeric-Event-Flags # default of 414 = MovedTo + MovedFrom + Renamed + Removed + Updated + Created # = 256 + 128+ 16 + 8 + 4 + 2 - EVENTS="--event=414" + EVENTS="${EVENTS:---event=414}" fi; else INW="$GW_INW_BIN";