Module: GitWand::CLI::Command::CreateRepository

Defined in:
lib/git_wand/cli/command/create_repository.rb

Class Method Summary collapse

Class Method Details

.perform(client:, repository_name:, private:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/git_wand/cli/command/create_repository.rb', line 6

def self.perform(client:, repository_name:, private:)
  parameters = {
    name: repository_name,
    private: private,
  }
  result = client.create_repository(parameters)
  if result.success?
    puts "[success] Repository #{repository_name} created"
    puts "- HTML URL: #{result.body["html_url"]}"
    puts "- SSH URL: #{result.body["ssh_url"]}"
    puts "- Visibility: #{private ? "Private" : "Public"}"
  else
    puts "[error] #{result.body["message"]}"
  end
end