From a5fc711e8a67124b02ec0b64744eaa6e765540e7 Mon Sep 17 00:00:00 2001 From: John McCrae Date: Thu, 5 May 2022 16:42:12 +0600 Subject: Updated the recipe to remove Git completely before updating it. Signed-off-by: John McCrae --- kitchen-tests/cookbooks/end_to_end/recipes/macos.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'kitchen-tests') diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb index f27d928155..403e098a47 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb @@ -72,11 +72,17 @@ user "tempadmin" do password "password" end +sudo 'passwordless-access to change git ownership' do + commands ['chown -R $(whoami) $(brew --prefix)/*'] + nopasswd true + users "tempadmin" +end + # We're overcoming a problem where Homebrew updating Git on MacOS throws a symlink error # We remove git completely to allow homebrew to update it. bash "remove git" do code <<~EOH - echo "password" | sudo chown -R $(whoami) $(brew --prefix)/* + # echo "password" | sudo chown -R $(whoami) $(brew --prefix)/* brew unlink git@2.35.1 EOH user "tempadmin" -- cgit v1.2.1