0

I'm trying to copy a directory from one folder to another folder like so:

directory "C:\\test\\go" do
  recursive true
  action :create
end

cookbook_file "C:\\Automation" do
  source "C:\\Automation"
  path "C:\\test\\go"
  action :create_if_missing
end

It creates the target folder C:\test\go but does not copy anything. The documentation says that it should also handle directories so any ideas why it does not? I've also tried a wildcard source "C:\Automation\*" and also tried forward slashed...

max
  • 9,708
  • 15
  • 89
  • 144

1 Answers1

2

Here is the solution:

ruby_block "get the windows resources" do
  block do
    FileUtils.mkdir_p mod_path
    FileUtils.cp_r(Dir["#{RESOURCE_DIR}/*.exe"], Chef::Config[:file_cache_path])
  end
end
max
  • 9,708
  • 15
  • 89
  • 144