lib/chef-cli/command/generate.rb in chef-cli-5.0.1 vs lib/chef-cli/command/generate.rb in chef-cli-5.1.0

- old
+ new

@@ -27,11 +27,10 @@ require_relative "generator_commands/recipe" require_relative "generator_commands/template" require_relative "generator_commands/repo" require_relative "generator_commands/policyfile" require_relative "generator_commands/generator_generator" -require_relative "generator_commands/build_cookbook" require_relative "../dist" module ChefCLI module Command class Generate < Base @@ -54,11 +53,11 @@ generator(:helpers, :Helpers, "Generate a cookbook helper file in libraries") generator(:resource, :Resource, "Generate a custom resource") generator(:repo, :Repo, "Generate a #{ChefCLI::Dist::INFRA_PRODUCT} code repository") generator(:policyfile, :Policyfile, "Generate a Policyfile for use with the install/push commands") generator(:generator, :GeneratorGenerator, "Copy #{ChefCLI::Dist::PRODUCT}'s generator cookbook so you can customize it") - generator(:'build-cookbook', :BuildCookbook, "Generate a build cookbook for use with #{ChefCLI::Dist::WORKFLOW}") + generator(:'build-cookbook', :BuildCookbook, "DEPRECATED: Generate a build cookbook for use with #{ChefCLI::Dist::WORKFLOW}") def self.banner_headline <<~E Usage: #{ChefCLI::Dist::EXEC} generate GENERATOR [options] @@ -81,10 +80,14 @@ def initialize(*args) super end def run(params) + if params[0] == "build-cookbook" + warn "[DEPRECATION] Chef Workflow (Delivery) is end of life (EOL) as of December 31, 2020 and this generator subcommand has been removed".freeze + return 1 + end if ( generator_spec = generator_for(params[0]) ) params.shift generator = GeneratorCommands.build(generator_spec.class_name, params) generator.run else @@ -116,9 +119,8 @@ end def have_generator?(name) self.class.generators.map { |g| g.name.to_s }.include?(name) end - end end end