I haven\'t yet come across a Chef resource that will copy/move files locally. For example, I want to download jetty hightide and unzip it. Once done, copy all the files into
You could give the ark cookbook a try. This extracts the file for you and you afterwards notice an execute
resource.
If your recipe is already tied to Windows, you can use embedded PowerShell scripts, like this:
# Copy files from "C:/foo/lib" to "C:/foo"
powershell_script "copy_lib" do
code <<-EOH
$ErrorActionPreference = "Stop"
Get-ChildItem -Path "C:/foo/lib" -File | Foreach-Object {
Copy-Item -Path $_.Fullname -Destination "C:/foo" -Force
}
EOH
end
# Delete "C:/foo/lib" folder
powershell_script "delete_lib" do
code <<-EOH
$ErrorActionPreference = "Stop"
Remove-Item -Path "C:/foo/lib" -Recurse
EOH
end