Merge pull request #86 from kirviq/master

double-double-quote target directory to support pathes with spaces
pull/91/head
Dave Musicant 4 years ago committed by GitHub
commit e62df74067
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -203,10 +203,10 @@ if [ -d "$1" ]; then # if the target is a directory
TARGETDIR=$(sed -e "s/\/*$//" <<<"$IN") # dir to CD into before using git commands: trim trailing slash, if any
# construct inotifywait-commandline
if [ "$(uname)" != "Darwin" ]; then
INW_ARGS=("-qmr" "-e" "$EVENTS" "--exclude" "'(\.git/|\.git$)'" "$TARGETDIR")
INW_ARGS=("-qmr" "-e" "$EVENTS" "--exclude" "'(\.git/|\.git$)'" "\"$TARGETDIR\"")
else
# still need to fix EVENTS since it wants them listed one-by-one
INW_ARGS=("--recursive" "$EVENTS" "--exclude" "'(\.git/|\.git$)'" "$TARGETDIR")
INW_ARGS=("--recursive" "$EVENTS" "--exclude" "'(\.git/|\.git$)'" "\"$TARGETDIR\"")
fi;
GIT_ADD_ARGS="--all ." # add "." (CWD) recursively to index
GIT_COMMIT_ARGS="" # add -a switch to "commit" call just to be sure

Loading…
Cancel
Save