hexo-deployer-rsync
hexo-deployer-rsync copied to clipboard
Can't exclude multiple directories
With args: '--exclude=dir1' works fine, dir1 is excluded. How to exclude multiple directories? I tried
args: '--exclude=dir1 --exclude=dir2'
args: '--exclude={dir1,dir2}'
exclude: [dir1, dir2]
exclude: ['dir1', 'dir2']
with no luck. Rsync doesn't exclude anything with these setups.
Well, finally I figured out that it can be done like this:
args: '--exclude-from=list-of-files-to-exclude'
where list-of-files-to-exclude is file where all directories and files to be excluded are listed:
dir1
dir2
Unfortunately I got the same problem at persent.
Thanks for the tip of --exclude-from.
I suspect some escaping happens when using multiple options, which is treated as a single option --exclude=dir1\ --exclude=dir2 (so the value of --exclude is dir1 --exclude=dir2).