lib/bolt/cli.rb
# Loads the project and configuration. All errors that are raised here are not
# handled by the outputter, as it relies on config being loaded.
Loads the project and configuration. All errors that are raised here are not
handled by the outputter, as it relies on config being loaded.
Loads the project and configuration . All errors that are raised here are not handled by the outputter as it relies on config being loaded .
def load_config
      @config = if ENV['BOLT_PROJECT']
                  project = Bolt::Project.create_project(ENV['BOLT_PROJECT'], 'environment')
                  Bolt::Config.from_project(project, options)
                elsif options[:configfile]
                  Bolt::Config.from_file(options[:configfile], options)
                else
                  project = if options[:boltdir]
                              dir = Pathname.new(options[:boltdir])
                              if (dir + Bolt::Project::BOLTDIR_NAME).directory?
                                Bolt::Project.create_project(dir + Bolt::Project::BOLTDIR_NAME)
                              else
                                Bolt::Project.create_project(dir)
                              end
                            else
                              Bolt::Project.find_boltdir(Dir.pwd)
                            end
                  Bolt::Config.from_project(project, options)
                end
    rescue Bolt::Error => e
      fatal_error(e)
      raise e
    end
def load_config @config = if ENV [ 'BOLT_PROJECT' ] project = Bolt :: Project . create_project ( ENV [ 'BOLT_PROJECT' ] , 'environment' ) Bolt :: Config . from_project ( project , options ) elsif options [ :configfile ] Bolt :: Config . from_file ( options [ :configfile ] , options ) else project = if options [ :boltdir ] dir = Pathname . new ( options [ :boltdir ] ) if ( dir + Bolt :: Project :: BOLTDIR_NAME ) . directory? Bolt :: Project . create_project ( dir + Bolt :: Project :: BOLTDIR_NAME ) else Bolt :: Project . create_project ( dir ) end else Bolt :: Project . find_boltdir ( Dir . pwd ) end Bolt :: Config . from_project ( project , options ) end rescue Bolt :: Error => e fatal_error ( e ) raise e end
Loads the project and configuration.
Loads the project and configuration .