Sha256: 9c2536a773d2cbac95b647c19a8b0d0c50eb9e36d8f66a43e469731c96d1845f

Contents?: true

Size: 1.21 KB

Versions: 35

Compression:

Stored size: 1.21 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 the J1 projects website'
            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

35 entries across 35 versions & 1 rubygems

Version Path
j1-template-2022.5.1 lib/j1/commands/rebuild.rb
j1-template-2022.5.1.rc1 lib/j1/commands/rebuild.rb
j1-template-2022.5.1.rc0 lib/j1/commands/rebuild.rb
j1-template-2022.5.0 lib/j1/commands/rebuild.rb
j1-template-2022.5.0.rc4 lib/j1/commands/rebuild.rb
j1-template-2022.5.0.rc3 lib/j1/commands/rebuild.rb
j1-template-2022.5.0.rc2 lib/j1/commands/rebuild.rb
j1-template-2022.5.0.rc1 lib/j1/commands/rebuild.rb
j1-template-2022.5.0.rc0 lib/j1/commands/rebuild.rb
j1-template-2022.3.0.rc1 lib/j1/commands/rebuild.rb
j1-template-2022.3.0.rc0 lib/j1/commands/rebuild.rb
j1-template-2022.4.10 lib/j1/commands/rebuild.rb
j1-template-2022.4.9 lib/j1/commands/rebuild.rb
j1-template-2022.4.8 lib/j1/commands/rebuild.rb
j1-template-2022.4.7 lib/j1/commands/rebuild.rb
j1-template-2022.4.6 lib/j1/commands/rebuild.rb
j1-template-2022.4.5 lib/j1/commands/rebuild.rb
j1-template-2022.4.4 lib/j1/commands/rebuild.rb
j1-template-2022.4.3 lib/j1/commands/rebuild.rb
j1-template-2022.4.2 lib/j1/commands/rebuild.rb