Skip to content

Commit 37f0b5b

Browse files
committed
Merge branch 'CHEF-1306'
2 parents 8d6de42 + 75608e1 commit 37f0b5b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎chef/lib/chef/knife/cookbook_site_vendor.rb‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ class CookbookSiteVendor < Knife
3232
:description => "Grab dependencies automatically"
3333

3434
def run
35-
vendor_path = File.join(Chef::Config[:cookbook_path].first)
35+
if config[:cookbook_path]
36+
vendor_path = File.expand_path(File.join(config[:cookbook_path].first))
37+
else
38+
Chef::Log.warn("cookbook path is not configured in your knife.rb, using the current directory for the cookbook repo")
39+
vendor_path = Dir.pwd
40+
end
3641
cookbook_path = File.join(vendor_path, name_args[0])
3742
upstream_file = File.join(vendor_path, "#{name_args[0]}.tar.gz")
3843
branch_name = "chef-vendor-#{name_args[0]}"

0 commit comments

Comments
 (0)