Sha256: 41283b642c041d63098d21f4febe50eb2adb752bdf0f7b1a0dc9743e5eb0e9bd

Contents?: true

Size: 1.02 KB

Versions: 28

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

usage 'check [options] [names]'
summary 'run issue checks'
description "
Run issue checks on the current site. If the `--all` option is passed, all available issue checks will be run. By default, the issue checks marked for deployment will be run.
"

flag :a, :all,    'run all checks'
flag :L, :list,   'list all checks'
flag :d, :deploy, '(deprecated)'

module Nanoc::CLI::Commands
  class Check < ::Nanoc::CLI::CommandRunner
    def run
      site = load_site

      runner = Nanoc::Checking::Runner.new(site)

      if options[:list]
        runner.list_checks
        return
      end

      success =
        if options[:all]
          runner.run_all
        elsif options[:deploy]
          runner.run_for_deploy
        elsif arguments.any?
          runner.run_specific(arguments)
        else
          runner.run_for_deploy
        end

      unless success
        raise Nanoc::Int::Errors::GenericTrivial, 'One or more checks failed'
      end
    end
  end
end

runner Nanoc::CLI::Commands::Check

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
nanoc-4.11.12 lib/nanoc/cli/commands/check.rb
nanoc-4.11.11 lib/nanoc/cli/commands/check.rb
nanoc-4.11.10 lib/nanoc/cli/commands/check.rb
nanoc-4.11.9 lib/nanoc/cli/commands/check.rb
nanoc-4.11.8 lib/nanoc/cli/commands/check.rb
nanoc-4.11.7 lib/nanoc/cli/commands/check.rb
nanoc-4.11.6 lib/nanoc/cli/commands/check.rb
nanoc-4.11.5 lib/nanoc/cli/commands/check.rb
nanoc-4.11.4 lib/nanoc/cli/commands/check.rb
nanoc-4.11.3 lib/nanoc/cli/commands/check.rb
nanoc-4.11.2 lib/nanoc/cli/commands/check.rb
nanoc-4.11.1 lib/nanoc/cli/commands/check.rb
nanoc-4.11.0 lib/nanoc/cli/commands/check.rb
nanoc-4.10.4 lib/nanoc/cli/commands/check.rb
nanoc-4.10.3 lib/nanoc/cli/commands/check.rb
nanoc-4.10.2 lib/nanoc/cli/commands/check.rb
nanoc-4.10.1 lib/nanoc/cli/commands/check.rb
nanoc-4.10.0 lib/nanoc/cli/commands/check.rb
nanoc-4.9.9 lib/nanoc/cli/commands/check.rb
nanoc-4.9.8 lib/nanoc/cli/commands/check.rb