Escape folder when calling sync from change listener

The old version would pass in an unescaped directory, which then got unescaped by the sync call.

In some cases it worked but resulted in foldername wold not matched reality (example: google-drive -> google/drive) and error out when checking if that folder exists.
pull/244/head
Jan Schulz 2018-12-03 21:21:49 +01:00
parent cf51167b55
commit e3e18fe16a
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ listen_directory() {
while true #run indefinitely
do
# Use a different call to not need to change exit into return
inotifywait -q -r -e modify,attrib,close_write,move,create,delete --exclude ".grive_state|.grive" "${_directory}" > /dev/null 2>&1 && ${SCRIPT} sync "${_directory}"
inotifywait -q -r -e modify,attrib,close_write,move,create,delete --exclude ".grive_state|.grive" "${_directory}" > /dev/null 2>&1 && ${SCRIPT} sync $(systemd-escape "${_directory}")
#echo ${SCRIPT} "${_directory}"
done