How to add additional "generator" commands? #44
Labels
Aspect: UX
How users feel interacting with the project, focusing on function, ease-of-use and accessibility.
documentation
How do we use this project?
Triage: Confirmed
Indicates and issue has been confirmed as described.
Triage: Feature Request
Indicates an issue requesting new functionality.
Triage: Needs Information
Indicates an issue needs more information in order to work on it.
Type: Design Proposal
Community survey of a proposal.
Type: Enhancement
Adds new functionality.
Description
I am looking to extend the ChefDK generator so that we can do things like
chef generate library helpers
which will generate thelibraries
directory and thelibraries/helper.rb
file with all of our standard boiler plate and the standard module layout we use for Coobook Libraries.ChefDK Version
working with 1.6.1, but have confirmed this in a current 2.4 ChefDK
Platform Version
CentOS 6.9, but confirmed on other platforms as well.
Replication Case
Have attempted to add the following to
.chef/knife.rb
(though not all at once)When I run
chef generate
I would expect to seexxxxxxx
orlibrary
oryyyyyyyy
as options, and if not displayed there, be able to runchef generate xxxxxxx
and have it load my library.If I edit
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.6.1/lib/chef-dk/command/generate.rb
I am able to add
generator(:xxxxxxx, :MyLibrary, "generate my lib")
And then run
chef generate
and see myxxxxxxx
option. (That then tries to loadChefDK::Command::GeneratorCommands::MyLibrary
, which I think is a whole other problem and, I think, easily dealt with if you create alib/chefdk/command/generator_commands/my_library.rb
andrequire_relative
...)Stacktrace
Not really applicable as no error message is generated.
The text was updated successfully, but these errors were encountered: