Git for Windows 1.9.5-preview20141217
[msysgit.git] / cmd / gitk.cmd
bloba89a26b531af61ebe88c2d824e98297bf7465329
1 @rem Do not use "echo off" to not affect any child calls.
3 @rem Enable extensions, the `verify other 2>nul` is a trick from the setlocal help
4 @verify other 2>nul
5 @setlocal enableDelayedExpansion
6 @if errorlevel 1 (
7 @echo Unable to enable delayed expansion. Immediate expansion will be used.
8 @goto fallback
11 @rem Get the absolute path to the parent directory, which is assumed to be the
12 @rem Git installation root.
13 @for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
14 @set PATH=!git_install_root!\bin;!git_install_root!\mingw\bin;!PATH!
16 @if not exist "!HOME!" @set HOME=!HOMEDRIVE!!HOMEPATH!
17 @if not exist "!HOME!" @set HOME=!USERPROFILE!
19 @start "gitk" wish.exe "!git_install_root!\bin\gitk" -- %*
20 @goto end
22 :fallback
23 @rem The above script again with immediate expansion, in case delayed expansion
24 @rem is unavailable.
25 @for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
26 @set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
28 @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
29 @if not exist "%HOME%" @set HOME=%USERPROFILE%
31 @start "gitk" wish.exe "%git_install_root%\bin\gitk" -- %*
33 :end
34 @rem End of script