소스 검색

fix(git): Fix the hook template directory

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 2 년 전
부모
커밋
aafdc7c985
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      cookbooks/workstation/attributes/_git.rb
  2. 2 1
      cookbooks/workstation/recipes/_git.rb

+ 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