diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-02-27 16:35:40 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-02-27 16:35:40 -0800 |
commit | 08bbb1bcbf584d30b7a1d82af9cd5f8490625899 (patch) | |
tree | 53d819efbe631b2af32228eb8c6c9c9f56e67d17 | |
parent | b76e0d03be912395b3d7f2ffdb4fbfc2771eb06d (diff) | |
download | chef-jdm/osx-fix.tar.gz |
Move tar_cmdjdm/osx-fix
-rw-r--r-- | lib/chef/knife/cookbook_site_share.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/chef/knife/cookbook_site_share.rb b/lib/chef/knife/cookbook_site_share.rb index 9dd05aff87..efd2e7f129 100644 --- a/lib/chef/knife/cookbook_site_share.rb +++ b/lib/chef/knife/cookbook_site_share.rb @@ -50,20 +50,6 @@ class Chef :default => false, :description => "Don't take action, only print what files will be upload to SuperMarket." - def tar_cmd - if !@tar_cmd - @tar_cmd = "tar" - begin - # Unix and Mac only - prefer gnutar - if shell_out("which gnutar").exitstatus.equal?(0) - @tar_cmd = "gnutar" - end - rescue Errno::ENOENT - end - end - @tar_cmd - end - def run config[:cookbook_path] ||= Chef::Config[:cookbook_path] @@ -164,6 +150,20 @@ class Chef end res end + + def tar_cmd + if !@tar_cmd + @tar_cmd = "tar" + begin + # Unix and Mac only - prefer gnutar + if shell_out("which gnutar").exitstatus.equal?(0) + @tar_cmd = "gnutar" + end + rescue Errno::ENOENT + end + end + @tar_cmd + end end end |