class ChefConfig::Config

def self.find_chef_repo_path(cwd)

def self.find_chef_repo_path(cwd)
  # In local mode, we auto-discover the repo root by looking for a path with "cookbooks" under it.
  # This allows us to run config-free.
  path = cwd
  until File.directory?(PathHelper.join(path, "cookbooks"))
    new_path = File.expand_path('..', path)
    if new_path == path
      ChefConfig.logger.warn("No cookbooks directory found at or above current directory.  Assuming #{Dir.pwd}.")
      return Dir.pwd
    end
    path = new_path
  end
  ChefConfig.logger.info("Auto-discovered chef repository at #{path}")
  path
end