summaryrefslogtreecommitdiff
path: root/lib/chef/knife/cookbook_site_install.rb
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2014-12-15 14:19:14 -0500
committerBryan McLellan <btm@loftninjas.org>2014-12-15 14:19:14 -0500
commit6c55cae2083b47cda466e969b11fe34b9f1e089b (patch)
tree4c04604e43810dc1bd7845051d9f6e0d3deaae31 /lib/chef/knife/cookbook_site_install.rb
parent1e71a0388df573c78f424fb202f1e373e2a1e770 (diff)
downloadchef-6c55cae2083b47cda466e969b11fe34b9f1e089b.tar.gz
Clean up knife cookbook site install tests
Diffstat (limited to 'lib/chef/knife/cookbook_site_install.rb')
-rw-r--r--lib/chef/knife/cookbook_site_install.rb6
1 files changed, 4 insertions, 2 deletions
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