Class: Bridgetown::Commands::Build
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Bridgetown::Commands::Build
- Extended by:
- BuildOptions, Summarizable
- Includes:
- ConfigurationOverridable
- Defined in:
- lib/bridgetown-core/commands/build.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#build ⇒ Object
Build your bridgetown site Continuously watch if
watch
is set to true in the config.
Methods included from BuildOptions
Methods included from Summarizable
Methods included from ConfigurationOverridable
#configuration_with_overrides, included
Class Method Details
.banner ⇒ Object
14 15 16 |
# File 'lib/bridgetown-core/commands/build.rb', line 14 def self. "bridgetown build [options]" end |
.print_startup_message ⇒ Object
24 25 26 27 |
# File 'lib/bridgetown-core/commands/build.rb', line 24 def self. Bridgetown.logger.info "Starting:", "Bridgetown v#{Bridgetown::VERSION.magenta} " \ "(codename \"#{Bridgetown::CODE_NAME.yellow}\")" end |
Instance Method Details
#build ⇒ Object
Build your bridgetown site
Continuously watch if watch
is set to true in the config.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/bridgetown-core/commands/build.rb', line 31 def build Bridgetown.logger.adjust_verbosity() # @type [Bridgetown::Configuration] = configuration_with_overrides( , Bridgetown::Current.preloaded_configuration ) self.class. unless ["start_command"] Process.setproctitle( "bridgetown #{Bridgetown::VERSION} " \ "(#{["start_command"] ? "start" : "build"}) [#{File.basename(Dir.pwd)}]" ) .run_initializers! context: :static if !Bridgetown.env.production? && ![:skip_frontend] && ["start_command"] if Bridgetown::Utils.frontend_bundler_type([:root_dir]) == :esbuild Bridgetown::Utils.update_esbuild_autogenerated_config end require "rake" Rake.with_application do |rake| rake.load_rakefile rake["frontend:watcher"].invoke(true) end end @site = Bridgetown::Site.new() if .fetch("skip_initial_build", false) Bridgetown.logger.warn "Build Warning:", "Skipping the initial build. " \ "This may result in an out-of-date site." else build_site() end # TODO: remove this logic…I can't find "detach" anywhere if .fetch("detach", false) Bridgetown.logger.info "Auto-regeneration:", "disabled when running server detached." elsif .fetch("watch", false) watch_site() else Bridgetown.logger.info "Auto-regeneration:", "disabled. Use --watch to enable." end end |