Sha256: ec609dd141b24c6dfcee449478d7db2875b9bee673337c35579f7c3ca9d323bf

Contents?: true

Size: 941 Bytes

Versions: 66

Compression:

Stored size: 941 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 site 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

66 entries across 66 versions & 1 rubygems

Version Path
j1-template-2023.2.1 lib/j1/commands/site.rb
j1-template-2023.2.0 lib/j1/commands/site.rb
j1-template-2023.1.0 lib/j1/commands/site.rb
j1-template-2023.0.17 lib/j1/commands/site.rb
j1-template-2023.0.16 lib/j1/commands/site.rb
j1-template-2023.0.15 lib/j1/commands/site.rb
j1-template-2023.0.14 lib/j1/commands/site.rb
j1-template-2023.0.13 lib/j1/commands/site.rb
j1-template-2023.0.12 lib/j1/commands/site.rb
j1-template-2023.0.11 lib/j1/commands/site.rb
j1-template-2023.0.10 lib/j1/commands/site.rb
j1-template-2023.0.9 lib/j1/commands/site.rb
j1-template-2023.0.8 lib/j1/commands/site.rb
j1-template-2023.0.7 lib/j1/commands/site.rb
j1-template-2023.0.6 lib/j1/commands/site.rb
j1-template-2023.0.5 lib/j1/commands/site.rb
j1-template-2023.0.3 lib/j1/commands/site.rb
j1-template-2023.0.2 lib/j1/commands/site.rb
j1-template-2023.0.1 lib/j1/commands/site.rb
j1-template-2023.0.0 lib/j1/commands/site.rb