diff options
Diffstat (limited to 'lib/gitlab_projects.rb')
-rw-r--r-- | lib/gitlab_projects.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index a6fa1b5..a27036b 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -18,9 +18,11 @@ class GitlabProjects attr_reader :full_path def self.create_hooks(path) - hook = File.join(path, 'hooks', 'update') - File.delete(hook) if File.exists?(hook) - File.symlink(File.join(ROOT_PATH, 'hooks', 'update'), hook) + %w(pre-receive post-receive).each do |hook_name| + hook = File.join(path, 'hooks', hook_name) + File.delete(hook) if File.exists?(hook) + File.symlink(File.join(ROOT_PATH, 'hooks', hook_name), hook) + end end def initialize |