fix git missing error on cmder mini cmd shell

This commit is contained in:
Dax T. Games 2018-04-12 21:32:38 -04:00
parent bc72f20a2d
commit 063f30c193
2 changed files with 11 additions and 15 deletions

View File

@ -76,5 +76,4 @@ exit /b
:::-------------------------------------------------------------------------------
echo ERROR: %~1
echo CMDER Shell Initialization has Failed!
exit /b

View File

@ -45,20 +45,17 @@ exit /b
%lib_console% debug-output :read_version "Env Var - git_executable=%git_executable%"
:: check if the executable actually exists
if not exist "%git_executable%" (
%lib_console% show_error "%git_executable%" does not exist!
exit /b -255
)
:: get the git version in the provided directory
for /F "tokens=1,2,3 usebackq" %%A in (`"%git_executable%" --version 2^>nul`) do (
if /i "%%A %%B" == "git version" (
set "GIT_VERSION_%~1=%%C"
%lib_console% debug-output :read_version "Env Var - GIT_VERSION_%~1=%%C"
) else (
%lib_console% show_error "git --version" returned an inproper version string!
pause
exit /b
if exist "%git_executable%" (
:: get the git version in the provided directory
for /F "tokens=1,2,3 usebackq" %%A in (`"%git_executable%" --version 2^>nul`) do (
if /i "%%A %%B" == "git version" (
set "GIT_VERSION_%~1=%%C"
%lib_console% debug-output :read_version "Env Var - GIT_VERSION_%~1=%%C"
) else (
%lib_console% show_error "git --version" returned an inproper version string!
pause
exit /b
)
)
)