Method: Consist::CLI#init

Defined in:
lib/consist/cli.rb

#init(gh_path = nil) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/consist/cli.rb', line 58

def init(gh_path = nil)
  if gh_path
    full_url = "https://github.com/#{gh_path}"
    Consist::Utils.clone_repo_contents(full_url, Dir.pwd)
  else
    puts "Creating new Consistfile..."
    directory "templates/consist", File.join(Dir.pwd, ".consist")
    template "templates/Consistfile.tt", File.join(Dir.pwd, "Consistfile")
    puts "...done"
  end
end