Fixed bug preventing cookbook upload if it doesn't have name in meta

This commit is contained in:
Mike Scherbakov 2012-06-29 18:37:46 +04:00
parent 9e1b1d6f9f
commit 8d8c484be6

View File

@ -20,7 +20,7 @@ def create_cookbook(metafile)
md = Chef::Cookbook::Metadata.new
md.from_file(metafile)
cook_name = md.name.empty? ? File.basename(src) : md.name
cook_name = md.name.empty? ? File.dirname(metafile) : md.name
recipes_dir = File.join(File.dirname(metafile), "recipes")
Dir.chdir(recipes_dir)