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.8.2.pre lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.8.1 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.8.0 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.8.0.pre2 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.8.0.pre lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.6 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.6.pre.pre lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.5 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.5pre lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.4 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.4.pre lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.3 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.3pre lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.2 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.2pre1 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.1 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.1.pre lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.0 lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.7.0.pre lib/metanorma/cli/commands/template_repo.rb
metanorma-cli-1.6.16 lib/metanorma/cli/commands/template_repo.rb