From f1c57b8ace7a72c22252f028600be1c7f9c9de07 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Mon, 1 Dec 2014 00:49:25 +0200 Subject: [PATCH] Don't fail if removing non-existing git proxy configuration Calling `git config --unset-all` for non-existing keys exits with non-zero exit code. We just ignore all the errors here. --- lib/vagrant-proxyconf/action/configure_git_proxy.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/vagrant-proxyconf/action/configure_git_proxy.rb b/lib/vagrant-proxyconf/action/configure_git_proxy.rb index 7101940..5f0dd89 100644 --- a/lib/vagrant-proxyconf/action/configure_git_proxy.rb +++ b/lib/vagrant-proxyconf/action/configure_git_proxy.rb @@ -21,13 +21,14 @@ def config end def configure_machine - command = "#{git_path} config --system " if config.http - command << "http.proxy #{config.http}" + @machine.communicate.sudo( + "#{git_path} config --system http.proxy #{config.http}") else - command << "--unset-all http.proxy" + @machine.communicate.sudo( + "#{git_path} config --system --unset-all http.proxy", + error_check: false) end - @machine.communicate.sudo(command) end def git_path