Skip to content

Commit

Permalink
#764: Fix IDEasy for CMD by adding Git related entries into PATH (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfeilex authored Dec 19, 2024
1 parent 35fc679 commit bc0d144
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Then run the `setup` and all should work fine.

Release with new features and bugfixes:

* https://github.com/devonfw/IDEasy/issues/764[#764]: Fix IDEasy in CMD
* https://github.com/devonfw/IDEasy/issues/774[#774]: HTTP proxy support not working properly
* https://github.com/devonfw/IDEasy/issues/792[#792]: Honor new variable IDE_OPTIONS in ide command wrapper
* https://github.com/devonfw/IDEasy/issues/589[#589]: Fix NLS Bundles for Linux and MacOS
Expand Down
15 changes: 15 additions & 0 deletions cli/src/main/package/bin/ide.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ Set _fBGreen=
Set _fBRed=
Set _RESET=

rem Add Git PATH entries for CMD - https://github.com/devonfw/IDEasy/issues/764
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

set "GIT_BIN=%GIT_HOME%\usr\bin"
set "GIT_CORE=%GIT_HOME%\mingw64\libexec\git-core"

if exist "%GIT_BIN%" (
echo "%PATH%" | find /i "%GIT_BIN%">nul || set "PATH=%PATH%;%GIT_BIN%"
)

if exist "%GIT_CORE%" (
echo "%PATH%" | find /i "%GIT_CORE%">nul || set "PATH=%PATH%;%GIT_CORE%"
)

if not "%1%" == "" (
ideasy %IDE_OPTIONS% %*
if not %ERRORLEVEL% == 0 (
Expand All @@ -17,6 +31,7 @@ REM https://stackoverflow.com/questions/61888625/what-is-f-in-the-for-loop-comma
for /f "tokens=*" %%i in ('ideasy %IDE_OPTIONS% env') do (
call set %%i
)

if not %ERRORLEVEL% == 0 (
echo IDE environment variables have been set for %IDE_HOME% in workspace %WORKSPACE%
)

0 comments on commit bc0d144

Please sign in to comment.