# # Cookbook:: workstation # Recipe:: _git # # Copyright:: 2022, The Authors, All Rights Reserved. include_recipe 'git' node['gateway']['_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