Skip to content

Commit 9bc6dae

Browse files
committed
Merge 'net-installer-proxy' into HEAD
This branch adds support for running the net installer in environments where a proxy is required to access the web (this is often the case in corporate setups). Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 054e57d + 783f742 commit 9bc6dae

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

net-installer/setup-git-sdk.bat

+25
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@
2222
@EXIT 1
2323
)
2424

25+
@REM Maybe we need a proxy?
26+
@IF %counter% GEQ 2 (
27+
@ECHO.
28+
@ECHO There was a problem accessing the MSys2 repositories
29+
@ECHO If your setup requires an HTTP proxy to access the web,
30+
@ECHO please specify it here, otherwise leave it empty.
31+
@ECHO.
32+
@SET /p proxy= "HTTP proxy: "
33+
)
34+
@REM Check the proxy variable here because of delayed expansion
35+
@IF NOT "%proxy%" == "" (
36+
@SET http_proxy=%proxy%
37+
@SET https_proxy=%proxy%
38+
)
39+
2540
@REM update the Pacman package indices first, then force-install msys2-runtime
2641
@REM (we ship with a stripped-down msys2-runtime, gpg and pacman), so that
2742
@REM pacman's post-install scripts run without complaining about heap problems
@@ -71,6 +86,16 @@
7186
CALL %cwd%\autorebase.bat
7287
)
7388

89+
@REM If an HTTP proxy is requires, configure it for Git Bash sessions,
90+
@REM but only if the environment variable was not already set globally
91+
@IF DEFINED proxy (
92+
@ECHO http_proxy=%proxy% > etc\profile.d\proxy.sh
93+
@ECHO https_proxy=%proxy% >> etc\profile.d\proxy.sh
94+
@ECHO export http_proxy https_proxy >> etc\profile.d\proxy.sh
95+
@ECHO.
96+
@ECHO Installed /etc/profile.d/proxy.sh to set proxy in Git Bash
97+
)
98+
7499
@REM Install shortcut on the desktop
75100
@ECHO.
76101
@ECHO Installing the 'Git SDK @@BITNESS@@-bit' shortcut on the Desktop

0 commit comments

Comments
 (0)