Class: Sambot::Chef::Hooks

Inherits:
Object
  • Object
show all
Defined in:
lib/sambot/chef/hooks.rb

Class Method Summary collapse

Class Method Details

.copyObject



7
8
9
10
11
12
13
# File 'lib/sambot/chef/hooks.rb', line 7

def self.copy
  working_path = '.git/hooks/pre-push'
  template_path = Template.new('pre-push').path
  File.delete(working_path) if File.exist?(working_path)
  FileUtils.cp(template_path, working_path)
  UI.debug("The pre-push Git hook has been added to the cookbook.")
end