apt_update

git_client 'install it'

user 'random' do
  manage_home true
  home '/home/random'
end

git_config 'add name to random' do
  user 'random'
  scope 'global'
  key 'user.name'
  value 'John Doe global'
end

git '/home/random/git_repo' do
  repository 'https://github.com/chef/chef-repo.git'
  user 'random'
end

git_config 'change local path' do
  user 'random'
  scope 'local'
  key 'user.name'
  value 'John Doe local'
  path '/home/random/git_repo'
end

git_config 'change system config' do
  scope 'system'
  key 'user.name'
  value 'John Doe system'
end

git_config 'url.https://github.com/.insteadOf' do
  value 'git://github.com/'
  scope 'system'
  options '--add'
end

apt_update

git_client 'install it'

home_dir =
  if windows?
    'C:/Users/random'
  elsif macos?
    '/Users/random'
  else
    '/home/random'
  end

user 'random' do
  manage_home true
  home home_dir
end

git_config 'add name to random' do
  user 'random'
  scope 'global'
  key 'user.name'
  value 'John Doe global'
end

git "#{home_dir}/git_repo" do
  repository 'https://github.com/chef/chef-repo.git'
  user 'random'
end

git_config 'change local path' do
  user 'random'
  scope 'local'
  key 'user.name'
  value 'John Doe local'
  path "#{home_dir}/git_repo"
end

git_config 'change system config' do
  scope 'system'
  key 'user.name'
  value 'John Doe system'
end

git_config 'url.https://github.com/.insteadOf' do
  value 'git://github.com/'
  scope 'system'
  options '--add'
end

Set home dir propertly between Windows and MacOS for testing
Set home dir propertly between Windows and MacOS for testing

Signed-off-by: Lance Albertson <3161cdc7bf197e4c3a35b9cbe358c79910f27e90@osuosl.org>
