Method: Chef::Application#set_specific_recipes

Defined in:
lib/chef/application.rb

#set_specific_recipesObject

Set the specific recipes to Chef::Config if the recipes are valid otherwise log a fatal error message and exit the application.



161
162
163
164
165
166
167
168
169
170
# File 'lib/chef/application.rb', line 161

def set_specific_recipes
  if cli_arguments.is_a?(Array) &&
      (cli_arguments.empty? || cli_arguments.all? { |file| File.file?(file) } )
    chef_config[:specific_recipes] =
      cli_arguments.map { |file| File.expand_path(file) }
  else
    Chef::Application.fatal!("Invalid argument; could not find the following recipe files: \"" +
      cli_arguments.select { |file| !File.file?(file) }.join('", "') + '"')
  end
end