diff options
author | Michael Pereira <pereira.m@gmail.com> | 2015-10-06 11:51:28 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-10-24 20:25:11 -0700 |
commit | ee6b56251fb0be8784939be6535e1ec78f4fc67c (patch) | |
tree | 5c520a7addd955511dbd6847d33d60b2272e6b48 | |
parent | f13cda49551524c446b53ba2f4a2c503ba45e922 (diff) | |
download | chef-ee6b56251fb0be8784939be6535e1ec78f4fc67c.tar.gz |
Only add tar option --force-local on Windows systems
-rw-r--r-- | lib/chef/knife/cookbook_site_install.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/knife/cookbook_site_install.rb b/lib/chef/knife/cookbook_site_install.rb index 0e9a90951b..cc68fe7897 100644 --- a/lib/chef/knife/cookbook_site_install.rb +++ b/lib/chef/knife/cookbook_site_install.rb @@ -142,7 +142,11 @@ 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}\" --force-local", :cwd => @install_path) + extract_command="tar zxvf \"#{convert_path upstream_file}\"" + if Chef::Platform.windows? + extract_command << " --force-local" + end + shell_out!(extract_command, :cwd => @install_path) end def clear_existing_files(cookbook_path) |