From 08bbb1bcbf584d30b7a1d82af9cd5f8490625899 Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Fri, 27 Feb 2015 16:35:40 -0800 Subject: Move tar_cmd --- lib/chef/knife/cookbook_site_share.rb | 28 ++++++++++++++-------------- 1 file 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 -- cgit v1.2.1