Skip to content

Commit bc0d144

Browse files
authored
#764: Fix IDEasy for CMD by adding Git related entries into PATH (#886)
1 parent 35fc679 commit bc0d144

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CHANGELOG.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Then run the `setup` and all should work fine.
1919

2020
Release with new features and bugfixes:
2121

22+
* https://github.com/devonfw/IDEasy/issues/764[#764]: Fix IDEasy in CMD
2223
* https://github.com/devonfw/IDEasy/issues/774[#774]: HTTP proxy support not working properly
2324
* https://github.com/devonfw/IDEasy/issues/792[#792]: Honor new variable IDE_OPTIONS in ide command wrapper
2425
* https://github.com/devonfw/IDEasy/issues/589[#589]: Fix NLS Bundles for Linux and MacOS

cli/src/main/package/bin/ide.bat

+15
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ Set _fBGreen=
55
Set _fBRed=
66
Set _RESET=
77

8+
rem Add Git PATH entries for CMD - https://github.com/devonfw/IDEasy/issues/764
9+
for %%H in ( HKEY_LOCAL_MACHINE HKEY_CURRENT_USER ) do for /F "usebackq tokens=2*" %%O in (`call "%SystemRoot%"\system32\reg.exe query "%%H\Software\GitForWindows" /v "InstallPath" 2^>nul ^| "%SystemRoot%\system32\findstr.exe" REG_SZ`) do set GIT_HOME=%%P
10+
11+
set "GIT_BIN=%GIT_HOME%\usr\bin"
12+
set "GIT_CORE=%GIT_HOME%\mingw64\libexec\git-core"
13+
14+
if exist "%GIT_BIN%" (
15+
echo "%PATH%" | find /i "%GIT_BIN%">nul || set "PATH=%PATH%;%GIT_BIN%"
16+
)
17+
18+
if exist "%GIT_CORE%" (
19+
echo "%PATH%" | find /i "%GIT_CORE%">nul || set "PATH=%PATH%;%GIT_CORE%"
20+
)
21+
822
if not "%1%" == "" (
923
ideasy %IDE_OPTIONS% %*
1024
if not %ERRORLEVEL% == 0 (
@@ -17,6 +31,7 @@ REM https://stackoverflow.com/questions/61888625/what-is-f-in-the-for-loop-comma
1731
for /f "tokens=*" %%i in ('ideasy %IDE_OPTIONS% env') do (
1832
call set %%i
1933
)
34+
2035
if not %ERRORLEVEL% == 0 (
2136
echo IDE environment variables have been set for %IDE_HOME% in workspace %WORKSPACE%
2237
)

0 commit comments

Comments
 (0)