Sha256: 713d66b693aa695f37b126eccf29b5a3b8a99b2903dc481055a6269affe5d5a9

Contents?: true

Size: 944 Bytes

Versions: 35

Compression:

Stored size: 944 Bytes

Contents

# frozen_string_literal: true

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

        def init_with_program(prog)
          prog.command(:site) do |c|
            c.description 'Run the website of a J1 project'
            c.syntax 'site'
            c.action do |args, options|
              J1::Commands::Site.process(args, options)
            end
          end
        end

        def process(args, options = {})
          timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
          if J1::Utils::is_project?
            if J1::Utils::is_project_setup?
              J1.logger.info "#{timestamp} - SITE: Starting up your site ..."
              process = J1::Utils::Exec2.run('SITE','npm', 'run', 'j1-site')
            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/site.rb
j1-template-2022.5.1.rc1 lib/j1/commands/site.rb
j1-template-2022.5.1.rc0 lib/j1/commands/site.rb
j1-template-2022.5.0 lib/j1/commands/site.rb
j1-template-2022.5.0.rc4 lib/j1/commands/site.rb
j1-template-2022.5.0.rc3 lib/j1/commands/site.rb
j1-template-2022.5.0.rc2 lib/j1/commands/site.rb
j1-template-2022.5.0.rc1 lib/j1/commands/site.rb
j1-template-2022.5.0.rc0 lib/j1/commands/site.rb
j1-template-2022.3.0.rc1 lib/j1/commands/site.rb
j1-template-2022.3.0.rc0 lib/j1/commands/site.rb
j1-template-2022.4.10 lib/j1/commands/site.rb
j1-template-2022.4.9 lib/j1/commands/site.rb
j1-template-2022.4.8 lib/j1/commands/site.rb
j1-template-2022.4.7 lib/j1/commands/site.rb
j1-template-2022.4.6 lib/j1/commands/site.rb
j1-template-2022.4.5 lib/j1/commands/site.rb
j1-template-2022.4.4 lib/j1/commands/site.rb
j1-template-2022.4.3 lib/j1/commands/site.rb
j1-template-2022.4.2 lib/j1/commands/site.rb