Sha256: e7dcc7ef91863033f677e682c88d5a18e246dd53f32531b5a42ace4abc50fdd0

Contents?: true

Size: 1.2 KB

Versions: 66

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

module J1
  module Commands
    class Rebuild < Command
      #noinspection MissingYardParamTag
      class << self

        def init_with_program(prog)
          prog.command(:rebuild) do |c|
            c.description 'Rebuild a J1 Project'
            c.syntax 'rebuild'
            c.action do |args, options|
              J1::Commands::Rebuild.process(args, options)
            end
          end
        end

        def process(args, options = {})
          if J1::Utils::is_project?
            if J1::Utils::is_project_setup?
              J1.logger.info "REBUILD: Rebuild the projects website ..."
              J1.logger.info "REBUILD: Be patient, this will take a while ..."
              process = J1::Utils::Exec2.run('REBUILD','npm', 'run', 'rebuild')
              if process.success?
                J1.logger.info "REBUILD: The projects website has been rebuild successfully."
                J1.logger.info "REBUILD: To open the site, run: j1 site"
              else
                raise SystemExit
              end
            else
              raise SystemExit
            end
          else
            raise SystemExit
          end
        end

      end
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
j1-template-2024.2.1 lib/j1/commands/rebuild.rb
j1-template-2024.2.0 lib/j1/commands/rebuild.rb
j1-template-2024.1.5 lib/j1/commands/rebuild.rb
j1-template-2024.1.4 lib/j1/commands/rebuild.rb
j1-template-2024.1.3 lib/j1/commands/rebuild.rb
j1-template-2024.1.2 lib/j1/commands/rebuild.rb
j1-template-2024.1.1 lib/j1/commands/rebuild.rb
j1-template-2024.1.0 lib/j1/commands/rebuild.rb
j1-template-2024.0.3 lib/j1/commands/rebuild.rb
j1-template-2024.0.2 lib/j1/commands/rebuild.rb
j1-template-2024.0.1 lib/j1/commands/rebuild.rb
j1-template-2024.0.0 lib/j1/commands/rebuild.rb
j1-template-2023.10.2 lib/j1/commands/rebuild.rb
j1-template-2023.10.1 lib/j1/commands/rebuild.rb
j1-template-2023.10.0 lib/j1/commands/rebuild.rb
j1-template-2023.9.2 lib/j1/commands/rebuild.rb
j1-template-2023.9.1 lib/j1/commands/rebuild.rb
j1-template-2023.9.0 lib/j1/commands/rebuild.rb
j1-template-2023.8.2 lib/j1/commands/rebuild.rb
j1-template-2023.8.1 lib/j1/commands/rebuild.rb