diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 46d912799..70174606c 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -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 diff --git a/cli/src/main/package/bin/ide.bat b/cli/src/main/package/bin/ide.bat index 86ccf60e2..6f0bdec0c 100644 --- a/cli/src/main/package/bin/ide.bat +++ b/cli/src/main/package/bin/ide.bat @@ -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 ( @@ -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% )