Sha256: 7179f6d7b02b6e68171a79c5289b2fc96c02cb646c0bc70bbd188038e2728aa5

Contents?: true

Size: 1.25 KB

Versions: 66

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 Theme 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

66 entries across 66 versions & 1 rubygems

Version Path
j1-template-2024.3.17 exe/j1
j1-template-2024.3.16 exe/j1
j1-template-2024.3.15 exe/j1
j1-template-2024.3.14 exe/j1
j1-template-2024.3.13 exe/j1
j1-template-2024.3.12 exe/j1
j1-template-2024.2.1 exe/j1
j1-template-2024.2.0 exe/j1
j1-template-2024.1.5 exe/j1
j1-template-2024.1.4 exe/j1
j1-template-2024.1.3 exe/j1
j1-template-2024.1.2 exe/j1
j1-template-2024.1.1 exe/j1
j1-template-2024.1.0 exe/j1
j1-template-2024.0.3 exe/j1
j1-template-2024.0.2 exe/j1
j1-template-2024.0.1 exe/j1
j1-template-2024.0.0 exe/j1
j1-template-2023.10.2 exe/j1
j1-template-2023.10.1 exe/j1