mirror of
https://github.com/cmderdev/cmder.git
synced 2025-01-11 00:39:08 +08:00
Ensure the right git path is found in case of shim.
If the git found is a shim, we need to follow the path to the actual git directory to set the GIT_INSTALL_ROOT variable. This happens when installing git via scoop for example.
This commit is contained in:
parent
66da1716bc
commit
a607f0f2d5
9
vendor/init.bat
vendored
9
vendor/init.bat
vendored
@ -154,8 +154,17 @@ if defined GIT_INSTALL_ROOT (
|
|||||||
for /F "delims=" %%F in ('where git.exe 2^>nul') do (
|
for /F "delims=" %%F in ('where git.exe 2^>nul') do (
|
||||||
:: get the absolute path to the user provided git binary
|
:: get the absolute path to the user provided git binary
|
||||||
pushd %%~dpF
|
pushd %%~dpF
|
||||||
|
:: check if there's shim - and if yes follow the path
|
||||||
|
if exist git.shim (
|
||||||
|
for /F "tokens=2 delims== " %%I in (git.shim) do (
|
||||||
|
pushd %%~dpI
|
||||||
set "test_dir=!CD!"
|
set "test_dir=!CD!"
|
||||||
popd
|
popd
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
set "test_dir=!CD!"
|
||||||
|
)
|
||||||
|
popd
|
||||||
|
|
||||||
:: get the version information for the user provided git binary
|
:: get the version information for the user provided git binary
|
||||||
%lib_git% read_version USER "!test_dir!"
|
%lib_git% read_version USER "!test_dir!"
|
||||||
|
Loading…
Reference in New Issue
Block a user