Fixed excluded files still get copied on Windows

This commit is contained in:
Zhongcheng Lao 2019-06-20 16:08:36 +08:00
parent cc703fd77c
commit 2e0c0df6ed
2 changed files with 4 additions and 4 deletions

View File

@ -15,8 +15,8 @@ module VagrantPlugins
excluded_dirs = []
excluded_files = []
excludes.map do |exclude|
excluded_path = platform_join expanded_path, exclude,
is_windows: !Vagrant::Util::Platform.wsl?
# Dir.glob accepts Unix style path only
excluded_path = platform_join expanded_path, exclude, is_windows: false
Dir.glob(excluded_path) do |e|
if directory?(e)
excluded_dirs << e

View File

@ -34,7 +34,7 @@ describe VagrantPlugins::HyperV::SyncHelper do
let(:expanded_hostpath) { expanded_hostpaths[host_type] }
before do
allow(Vagrant::Util::Platform).to receive(:wsl?).and_return(!is_windows)
allow(Vagrant::Util::Platform).to receive(:wsl?).and_return(false)
allow(subject).to receive(:expand_path).with(hostpath).and_return(expanded_hostpath)
end
@ -44,7 +44,7 @@ describe VagrantPlugins::HyperV::SyncHelper do
exclude_dirs.map do |dir|
fullpath = [expanded_hostpath, dir[0..-2]].join(separator)
allow(subject).to receive(:platform_join).
with(expanded_hostpath, dir, is_windows: is_windows).and_return(fullpath)
with(expanded_hostpath, dir, is_windows: false).and_return(fullpath)
ignore_paths = []
allow(described_class).to receive(:directory?).with(fullpath).and_return(true)