mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-05-29 21:12:50 +00:00
Fix scoop not using proxy for git commands (#843)
Commands that call git from scoop will now pass proxy details. The command is executed using `cmd` to avoid polluting the user's environment as the variables set will die with the process. Fixes #842
This commit is contained in:
committed by
Luke Sampson
parent
5fccde3e7e
commit
637480f5b8
+25
@@ -0,0 +1,25 @@
|
||||
function git_proxy_cmd {
|
||||
$proxy = $(scoop config proxy)
|
||||
$cmd = "SET HTTPS_PROXY=$proxy&&SET HTTP_PROXY=$proxy&&git $($args |% { "$_ " })"
|
||||
cmd /c $cmd
|
||||
}
|
||||
|
||||
function git_clone {
|
||||
git_proxy_cmd clone $args
|
||||
}
|
||||
|
||||
function git_ls_remote {
|
||||
git_proxy_cmd ls-remote $args
|
||||
}
|
||||
|
||||
function git_pull {
|
||||
git_proxy_cmd pull $args
|
||||
}
|
||||
|
||||
function git_fetch {
|
||||
git_proxy_cmd fetch $args
|
||||
}
|
||||
|
||||
function git_log {
|
||||
git_proxy_cmd log $args
|
||||
}
|
||||
Reference in New Issue
Block a user