From 6c55cae2083b47cda466e969b11fe34b9f1e089b Mon Sep 17 00:00:00 2001 From: Bryan McLellan Date: Mon, 15 Dec 2014 14:19:14 -0500 Subject: Clean up knife cookbook site install tests --- lib/chef/knife/cookbook_site_install.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/chef/knife/cookbook_site_install.rb b/lib/chef/knife/cookbook_site_install.rb index 3242dd4297..edf8dd14f0 100644 --- a/lib/chef/knife/cookbook_site_install.rb +++ b/lib/chef/knife/cookbook_site_install.rb @@ -17,11 +17,11 @@ # require 'chef/knife' +require 'chef/exceptions' require 'shellwords' class Chef class Knife - class CookbookSiteInstall < Knife deps do @@ -141,6 +141,7 @@ class Chef def extract_cookbook(upstream_file, version) ui.info("Uncompressing #{@cookbook_name} version #{version}.") + # FIXME: Detect if we have the bad tar from git on Windows: https://github.com/opscode/chef/issues/1753 shell_out!("tar zxvf #{convert_path upstream_file}", :cwd => @install_path) end @@ -150,6 +151,7 @@ class Chef end def convert_path(upstream_file) + # converts a Windows path (C:\foo) to a mingw path (/c/foo) if ENV['MSYSTEM'] == 'MINGW32' return upstream_file.sub(/^([[:alpha:]]):/, '/\1') else @@ -162,7 +164,7 @@ class Chef # # @raise if there is no metadata in the cookbook # - # @return [Chef::Cookbok::Metadata] + # @return [Chef::Cookbook::Metadata] def preferred_metadata md = Chef::Cookbook::Metadata.new -- cgit v1.2.1