-
Notifications
You must be signed in to change notification settings - Fork 613
/
Copy pathsetup-git-sdk.bat
executable file
·50 lines (39 loc) · 1.22 KB
/
setup-git-sdk.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@REM Set up the Git SDK
@REM determine root directory
@REM https://technet.microsoft.com/en-us/library/bb490909.aspx says:
@REM <percent>~dpI Expands <percent>I to a drive letter and path only.
@REM <percent>~fI Expands <percent>I to a fully qualified path name.
@FOR /F "delims=" %%D in ("%~dp0") do @set cwd=%%~fD
@CD "%cwd%"
@IF ERRORLEVEL 1 GOTO DIE
@REM set PATH
@set PATH=%cwd%\mini\@@MSYSTEM_LOWER@@\bin;%PATH%
@ECHO Cloning the Git for Windows SDK...
@git init
@IF ERRORLEVEL 1 GOTO DIE
@git config http.sslbackend schannel
@IF ERRORLEVEL 1 GOTO DIE
@git remote add origin @@GIT_SDK_URL@@
@IF ERRORLEVEL 1 GOTO DIE
@git fetch --depth 1 origin
@IF ERRORLEVEL 1 GOTO DIE
@git -c core.fscache=true checkout -t origin/main
@IF ERRORLEVEL 1 GOTO DIE
@REM Cleaning up temporary git.exe
@RMDIR /Q /S mini
@IF ERRORLEVEL 1 GOTO DIE
@REM Avoid overlapping address ranges
@IF 32 == @@SDK_ARCH@@ @(
ECHO Auto-rebasing .dll files
CALL autorebase.bat
)
@REM Before running a shell, let's prevent complaints about "permission denied"
@REM from MSYS2's /etc/post-install/01-devices.post
@MKDIR dev\shm 2> NUL
@MKDIR dev\mqueue 2> NUL
@START /B git-bash.exe
@EXIT /B 0
:DIE
@ECHO Installation of Git for Windows' SDK failed!
@PAUSE
@EXIT /B 1