class Chef::Knife::CookbookMetadataFromFile

Public Instance Methods

run() click to toggle source
# File lib/chef/knife/cookbook_metadata_from_file.rb, line 33
def run
  if @name_args.length < 1
    show_usage
    ui.fatal("You must specify the FILE.")
    exit(1)
  end

  file = @name_args[0]
  cookbook = File.basename(File.dirname(file))

  @metadata = Chef::Knife::CookbookMetadata.new
  @metadata.generate_metadata_from_file(cookbook, file)
end