When using chef generate cookbook
, it generates with some default attributes for copyright, license, and email. I went looking for how to override those, and it doesn’t appear to be documented anywhere. The attributes that worked for knife cookbook create
:
cookbook_copyright "MyCo"
cookbook_email "me@example.com"
are ignored by ChefDK’s generators.
After a little spelunking through the ChefDK source code, I found that if I put the following in ~/.chef/config.rb, it worked:
chefdk.generator.copyright_holder "MyCo"
chefdk.generator.license "apache2"
chefdk.generator.email "me@example.com"
Yay for progress! I can run chef generate cookbook
and everything works great. Until I run Berkshelf, that is…
PS C:\Users\l.wright\Documents\code\mycookbook> berks
C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-config-12.7.2/lib/chef-config/workstation_config_loader.rb:161:in `rescue in read_config': You have an error in your config file C:/Users/l.wright/.chef/config.rb (ChefConfig::ConfigurationError)
NoMethodError: undefined method `copyright_holder' for nil:NilClass
C:/Users/l.wright/.chef/config.rb:1:in `from_string'
Is there a way to set these defaults that will make both ChefDK and berks happy?