summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-02-27 16:35:40 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2015-02-27 16:35:40 -0800
commit08bbb1bcbf584d30b7a1d82af9cd5f8490625899 (patch)
tree53d819efbe631b2af32228eb8c6c9c9f56e67d17
parentb76e0d03be912395b3d7f2ffdb4fbfc2771eb06d (diff)
downloadchef-08bbb1bcbf584d30b7a1d82af9cd5f8490625899.tar.gz
Move tar_cmdjdm/osx-fix
-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