Skip to content

Commit

Permalink
update tests for knife cookbook site install on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
btm committed Apr 3, 2012
1 parent 5b70a78 commit 5588b9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chef/lib/chef/knife/cookbook_site_install.rb
Expand Up @@ -130,7 +130,7 @@ def download_cookbook_to(download_path)

def extract_cookbook(upstream_file, version)
ui.info("Uncompressing #{@cookbook_name} version #{version}.")
shell_out!("tar zxvf '#{upstream_file}'", :cwd => @install_path)
shell_out!("tar zxvf #{Shellwords.escape upstream_file}", :cwd => @install_path)
end

def clear_existing_files(cookbook_path)
Expand Down
6 changes: 5 additions & 1 deletion chef/spec/unit/knife/cookbook_site_install_spec.rb
Expand Up @@ -23,7 +23,11 @@
require 'chef/knife/core/cookbook_scm_repo'
@knife = Chef::Knife::CookbookSiteInstall.new
@knife.config = {}
@install_path = "/var/tmp/chef"
if Chef::Platform.windows?
@install_path = "C:\tmp\chef"
else
@install_path = "/var/tmp/chef"
end
@knife.config[:cookbook_path] = [ @install_path ]

@stdout = StringIO.new
Expand Down

0 comments on commit 5588b9e

Please sign in to comment.