Sha256: a43144dd04f3d308169b1c6559dc588447a5581db4f4fbfbcc1f6aa5812e7389

Contents?: true

Size: 645 Bytes

Versions: 193

Compression:

Stored size: 645 Bytes

Contents

require "metanorma/cli/template_repo"
require "metanorma/cli/thor_with_config"

module Metanorma
  module Cli
    module Commands
      class TemplateRepo < ThorWithConfig
        desc "add NAME SOURCE", "Add new metanorma templates repository"
        option :overwrite, aliases: "-y", type: :boolean, desc: "Overwrite existing template"

        def add(name, source)
          Metanorma::Cli::TemplateRepo.add(name, source, options)
          UI.say("Template repo: #{name} has been added successfully")

        rescue Errors::DuplicateTemplateError
          UI.error("Duplicate metanorma template")
        end
      end
    end
  end
end

Version data entries

193 entries across 193 versions & 1 rubygems

Version Path
metanorma-cli-1.11.4 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.11.3 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.11.2 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.11.1 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.11.0 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.11 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.10 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.9 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.8 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.7 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.6 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.5 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.3 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.2 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.1 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.10.0 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.9.7 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.9.6 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.9.5 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.9.4 lib/metanorma/cli/commands/template_repo.rb