summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/knife/cookbook_site_share.rb28
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