-
Notifications
You must be signed in to change notification settings - Fork 18
/
mgit.cmd
23 lines (23 loc) · 691 Bytes
/
mgit.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@echo off
setlocal enabledelayedexpansion
REM # Find bash.exe from a git installation and run our git wrapper with it.
REM # For this to work git.exe must be in PATH and bash.exe must be
REM # in ../bin (MSysGit) or ../usr/bin (Git for Windows).
:begin
call :set_dir git.exe
if exist !dir! goto git_found
goto git_not_found
:set_dir
set "dir=%~$PATH:1"
goto end
:git_found
rem set PATH so that local binaries take priority over MSYS ones.
set "PATH=/bin;%PATH%"
set "BASH=%dir:~0,-12%\bin\bash.exe"
if not exist "%BASH%" set "BASH=%dir:~0,-12%\usr\bin\bash.exe"
"%BASH%" "%~dp0mgit" %*
goto end
:git_not_found
echo git.exe not found in PATH
goto end
:end