Class: Labelito::CommandTool

Inherits:
Thor
  • Object
show all
Defined in:
lib/Labelito.rb

Overview

Instance Method Summary collapse

Instance Method Details

#clone(from_repo, to_repo) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/Labelito.rb', line 14

def clone(from_repo, to_repo)
  token = options[:github_token]
  token ||= ENV["LABELITO_GITHUB_TOKEN"]
  if token == nil
    puts("You should pass a token or define it as a environment variable, LABELITO_GITHUB_TOKEN")
    exit -1
  end
  tool = Labelito::Tool.with_token(token)
  tool.clone(from_repo, to_repo)
end

#create(template_path, repo) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/Labelito.rb', line 27

def create(template_path, repo)
  token = options[:github_token]
  token ||= ENV["LABELITO_GITHUB_TOKEN"]
  if token == nil
    puts("You should pass a token or define it as a environment variable, LABELITO_GITHUB_TOKEN")
    exit -1
  end
  tool = Labelito::Tool.with_token(token)
  tool.create(template_path, repo)
end