Class: GitHooks::CLI

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

Instance Method Summary collapse

Instance Method Details

#initObject



24
25
26
27
28
29
30
# File 'lib/git_hooks/cli.rb', line 24

def init
  example_file = File.expand_path(
    '../../../git_hooks.yml.example', __FILE__
  )
  destination_path = File.expand_path('.git_hooks.yml', Dir.pwd)
  FileUtils.cp(example_file, destination_path)
end

#install(hook) ⇒ Object



14
15
16
# File 'lib/git_hooks/cli.rb', line 14

def install(hook)
  GitHooks::Installer.new(hook).install(options[:force])
end