Class: Bridgetown::Commands::Build
- Inherits:
-
Bridgetown::Command
- Object
- Samovar::Command
- Bridgetown::Command
- Bridgetown::Commands::Build
- Includes:
- ConfigurationOverridable
- Defined in:
- bridgetown-core/lib/bridgetown-core/commands/build.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#call ⇒ Object
Build your bridgetown site Continuously watch if
watchis set to true in the config.
Methods included from ConfigurationOverridable
#configuration_with_overrides, include_options
Methods inherited from Bridgetown::Command
Class Method Details
.print_startup_message ⇒ Object
15 16 17 18 |
# File 'bridgetown-core/lib/bridgetown-core/commands/build.rb', line 15 def self. Bridgetown.logger.info "Starting:", "Bridgetown v#{Bridgetown::VERSION.magenta} " \ "(codename \"#{Bridgetown::CODE_NAME.yellow}\")" end |
Instance Method Details
#call ⇒ Object
Build your bridgetown site
Continuously watch if watch is set to true in the config.
22 23 24 25 26 27 28 29 30 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 |
# File 'bridgetown-core/lib/bridgetown-core/commands/build.rb', line 22 def call # rubocop:disable Metrics 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 invoke_frontend_watcher_from_rake 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 if .fetch("watch", false) watch_site() else Bridgetown.logger.info "Auto-regeneration:", "disabled. Use --watch to enable." end end |