forked from ScoopInstaller/Scoop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scoop not using proxy for git commands (ScoopInstaller#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 ScoopInstaller#842
- Loading branch information
1 parent
5fccde3
commit 637480f
Showing
4 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters