From c2bf1061c2b5c739f4ced047e7cda4ce2a4929df Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 4 Feb 2013 10:08:13 +0200 Subject: link post-receive hook also --- lib/gitlab_projects.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/gitlab_projects.rb') diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index 89fb603..ae8cb2d 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -10,6 +10,7 @@ class GitlabProjects @project_name = ARGV.shift @repos_path = GitlabConfig.new.repos_path @full_path = File.join(@repos_path, @project_name) + @hook_path = File.join(ROOT_PATH, 'hooks', 'post-receive') end def exec @@ -24,8 +25,8 @@ class GitlabProjects protected def add_project - FileUtils.mkdir_p(@full_path, mode: 0770 ) - cmd = "cd #{@full_path} && git init --bare" + FileUtils.mkdir_p(@full_path, mode: 0770) + cmd = "cd #{@full_path} && git init --bare && ln -s #{@hook_path} #{@full_path}/hooks/post-receive" system(cmd) end -- cgit v1.2.1