Ver código fonte

fix(git): Only use the default_user

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 3 anos atrás
pai
commit
bfe225b803
1 arquivos alterados com 11 adições e 12 exclusões
  1. 11 12
      cookbooks/workstation/recipes/_git.rb

+ 11 - 12
cookbooks/workstation/recipes/_git.rb

@@ -23,18 +23,17 @@ end
 
   include_recipe 'git'
 
-  node['workstation']['_git'].each do |scope_git, git_options|
-    if scope_git.match(/^file_/)
-      gitconfig_file = $' # String after the match (ref: https://ruby-doc.org/core-2.5.1/Regexp.html#class-Regexp-label-Special+global+variables)
-      scope_git = 'file'
-    end
-    git_options.each do |k, v|
-      git_config k do
-        value v.to_s
-        scope scope_git
-        user username if %w{global file}.include?(scope_git)
-        config_file gitconfig_file if scope_git == 'file'
-      end
+node['workstation']['_git'].each do |scope_git, git_options|
+  if scope_git.match(/^file_/)
+    gitconfig_file = $' # String after the match (ref: https://ruby-doc.org/core-2.5.1/Regexp.html#class-Regexp-label-Special+global+variables)
+    scope_git = 'file'
+  end
+  git_options.each do |k, v|
+    git_config k do
+      value v.to_s
+      scope scope_git
+      user username if %w{global file}.include?(scope_git)
+      config_file gitconfig_file if scope_git == 'file'
     end
   end
 end