Sha256: aa34e2689fbea1ee90e567f61b91d9cf5e28827dd821041b9f87096eeed09d11

Contents?: true

Size: 1.25 KB

Versions: 43

Compression:

Stored size: 1.25 KB

Contents

#!/usr/bin/env ruby

STDOUT.sync = true
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'j1'
require 'mercenary'

Mercenary.program(:j1) do |p|
  p.version J1::VERSION
  p.description 'J1 Template is a gem-based Template made for Jekyll'
  p.syntax 'j1 <subcommand> [options]'

  # available options for all subcommands
  #
  # p.option 'force', '--force'
  # p.option 'skip-bundle', '--skip-bundle'
  # p.option 'skip-patches', '--skip-patches'
  # p.option 'system', '--system'

  # J1::External.require_if_present(J1::External.blessed_gems) do |g, ver_constraint|
  #   cmd = g.split("-").last
  #   p.command(cmd.to_sym) do |c|
  #     c.syntax cmd
  #     c.action do
  #       J1.logger.abort_with "You must install the '#{g}' gem" \
  #         " version #{ver_constraint} to use the 'jekyll #{cmd}' command."
  #     end
  #   end
  # end

  J1::Command.subclasses.each { |c| c.init_with_program(p) }

  p.action do |args, _|
    if args.empty?
      J1.logger.error "A subcommand is required."
      puts p
      abort
    else
      subcommand = args.first
      unless p.has_command? subcommand
        J1.logger.abort_with "fatal: 'j1 #{args.first}' failed." \
          " No subcommand '#{args.first}' available."
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
j1-template-2022.6.3 exe/j1
j1-template-2022.6.2 exe/j1
j1-template-2022.6.1 exe/j1
j1-template-2022.6.0 exe/j1
j1-template-2022.5.3 exe/j1
j1-template-2022.5.2 exe/j1
j1-template-2022.5.1 exe/j1
j1-template-2022.5.1.rc1 exe/j1
j1-template-2022.5.1.rc0 exe/j1
j1-template-2022.5.0 exe/j1
j1-template-2022.5.0.rc4 exe/j1
j1-template-2022.5.0.rc3 exe/j1
j1-template-2022.5.0.rc2 exe/j1
j1-template-2022.5.0.rc1 exe/j1
j1-template-2022.5.0.rc0 exe/j1
j1-template-2022.3.0.rc1 exe/j1
j1-template-2022.3.0.rc0 exe/j1
j1-template-2022.4.10 exe/j1
j1-template-2022.4.9 exe/j1
j1-template-2022.4.8 exe/j1