nachoparker/cpv

Filenames with Spaces doesn't work.

Opened this issue · 2 comments

cpv completed/folder2/file\ -\ with\ space.txt ../dest\ folder/
completed/folder2/file doesn't exist

For anyone coming across this in the future, the quick fix is to update line 59 cpv "${srcs[@]}" "$dir"; with the following

      # escape sub directories
      local escsubdir=()
      for subdir in "${srcs[@]}"; do
        echo "subdir: $subdir"
        escsubdir+=( "$subdir" )
      done
      cpv "${escsubdir[@]}" "$dir";

Note, I'm not claiming this is the best approach, but it worked for my use case.

@leachuk , care to send a PR?