File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ dst=${@:$#:1} # last argument - target directory to create the hard links in
99for d in " ${dir[@]} " ; do if [[ ! -d " $d " ]] ; then echo Source directory " $d " does not exist - exiting ; exit 1 ; fi ; done
1010if [[ ! -d " $dst " ]] ; then echo Target directory " $dst " does not exist - exiting ; exit 1 ; fi
1111tmp=$( mktemp) # tmp file to collect the links so we can cleanup those that don't belong in the target dir afterwards with cleanup_links
12- grep -arlF " com.apple.metadata:_kMDItemUserTags" " ${dir[@]} " --include=' *@SynoEAStream' --exclude=' *.html@SynoEAStream' --exclude=' *.jpg@SynoEAStream' | grep -v -- " -/" | xargs -d' \n' grep -alF " $tag " | while read i ; do
12+ grep -rlF " com.apple.metadata:_kMDItemUserTags" " ${dir[@]} " --include=' *@SynoEAStream' --exclude=' *.html@SynoEAStream' --exclude=' *.jpg@SynoEAStream' | grep -v -- " -/" | xargs -d' \n' grep -alF " $tag " | while read i ; do
1313i=${i/@ eaDir\/ } ; i=${i%@ SynoEAStream}
1414# prefiltered candidate file with tag string in it is found - make sure it is a regular file (i.e. not a directory) and that the $tag is actually present in the xattrs data structure (grep -x matches the whole line)
1515if [[ -f " $i " && -n $( tag " $i " | grep -xF " $tag " ) ]] ; then
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ dst=${@:$#:1} # last argument - target directory to create the hard links in
66for d in " ${dir[@]} " ; do if [[ ! -d " $d " ]] ; then echo Source directory " $d " does not exist - exiting ; exit 1 ; fi ; done
77if [[ ! -d " $dst " ]] ; then echo Target directory " $dst " does not exist - exiting ; exit 1 ; fi
88tmp=$( mktemp) # tmp file to collect the links so we can cleanup those that don't belong in the target dir afterwards with cleanup_links
9- grep -arlF " com.apple.metadata:_kMDItemUserTags" " ${dir[@]} " --include=' *@SynoEAStream' --exclude=' *.html@SynoEAStream' --exclude=' *.jpg@SynoEAStream' | grep -v -- " -/" | while read i ; do
9+ grep -rlF " com.apple.metadata:_kMDItemUserTags" " ${dir[@]} " --include=' *@SynoEAStream' --exclude=' *.html@SynoEAStream' --exclude=' *.jpg@SynoEAStream' | grep -v -- " -/" | while read i ; do
1010i=${i/@ eaDir\/ } ; i=${i%@ SynoEAStream}
1111# prefiltered candidate file with tag string(s) in it is found - make sure it is a regular file.ext (i.e. not a directory)
1212if [[ -f $i && ${i##*/ } == * .* ]] ; then
You can’t perform that action at this time.
0 commit comments