Переглянути джерело

fix(git): Fix the hook template directory

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 2 роки тому
батько
коміт
aafdc7c985

+ 1 - 1
cookbooks/workstation/attributes/_git.rb

@@ -1,4 +1,4 @@
-default['workstation']['_git']['hooksPath'] = '~/.git-templates/hooks'
+default['workstation']['_git']['hooksPath'] = '${HOME}/git-templates/hooks'
 default['workstation']['_git']['scope']['system'] = {
   'color.ui': true,
   'color.diff': 'auto',

+ 2 - 1
cookbooks/workstation/recipes/_git.rb

@@ -27,7 +27,8 @@ node['workstation']['_git']['scope'].each do |scope_git, git_options|
   end
 end
 
-directory node['workstation']['_git']['hooksPath'] do
+directory 'git-template' do
+  path lazy { Mixlib::ShellOut.new("readlink -f #{node['workstation']['_git']['hooksPath']}", :user => username, :login => true).run_command.stdout.chomp }
   recursive true
 end