class ChefConfig::WorkstationConfigLoader
def locate_local_config
def locate_local_config candidate_configs = [] # Look for $KNIFE_HOME/knife.rb (allow multiple knives config on same machine) if env['KNIFE_HOME'] candidate_configs << File.join(env['KNIFE_HOME'], 'config.rb') candidate_configs << File.join(env['KNIFE_HOME'], 'knife.rb') end # Look for $PWD/knife.rb if Dir.pwd candidate_configs << File.join(Dir.pwd, 'config.rb') candidate_configs << File.join(Dir.pwd, 'knife.rb') end # Look for $UPWARD/.chef/knife.rb if chef_config_dir candidate_configs << File.join(chef_config_dir, 'config.rb') candidate_configs << File.join(chef_config_dir, 'knife.rb') end # Look for $HOME/.chef/knife.rb PathHelper.home('.chef') do |dot_chef_dir| candidate_configs << File.join(dot_chef_dir, 'config.rb') candidate_configs << File.join(dot_chef_dir, 'knife.rb') end candidate_configs.find do | candidate_config | have_config?(candidate_config) end end