diff options
-rwxr-xr-x | watch-calendars | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/watch-calendars b/watch-calendars index e55e6b8..7c02e06 100755 --- a/watch-calendars +++ b/watch-calendars @@ -10,11 +10,9 @@ if [ $# -eq 0 ]; then fi while [ -d "$1" ]; do - inotifywait -r "$1" -e CREATE,MOVED_TO -t 30 - if [ $? -eq 0 ]; then - git -C "$1" add . - git -C "$1" commit -m'update by '"$(whoami)"'@'"$(hostname)"' on '"$(date)" - fi + inotifywait -r "$1" -e CREATE,MOVED_TO,DELETE -t 30 + git -C "$1" add -A + git -C "$1" commit -m'update by '"$(whoami)"'@'"$(hostname)"' on '"$(date)" git -C "$1" pull --rebase git -C "$1" push done |