Skip to content

Commit

Permalink
Don't fail if removing non-existing git proxy configuration
Browse files Browse the repository at this point in the history
Calling `git config --unset-all` for non-existing keys exits with
non-zero exit code. We just ignore all the errors here.
  • Loading branch information
tmatilai committed Nov 30, 2014
1 parent a7110ea commit f1c57b8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/vagrant-proxyconf/action/configure_git_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f1c57b8

Please sign in to comment.