diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index b7403ddbe..84904ec6e 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -6,6 +6,7 @@ This file documents all notable changes to https://github.com/devonfw/IDEasy[IDE Release with new features and bugfixes: +* https://github.com/devonfw/IDEasy/issues/894[#894]: Fix ide.bat printing for initialization and error output The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/18?closed=1[milestone 2025.01.001]. diff --git a/cli/src/main/package/bin/ide.bat b/cli/src/main/package/bin/ide.bat index 6f0bdec0c..b3e8e0a33 100644 --- a/cli/src/main/package/bin/ide.bat +++ b/cli/src/main/package/bin/ide.bat @@ -21,10 +21,7 @@ if exist "%GIT_CORE%" ( if not "%1%" == "" ( ideasy %IDE_OPTIONS% %* - if not %ERRORLEVEL% == 0 ( - echo %_fBRed%Error: IDEasy failed with exit code %ERRORLEVEL% %_RESET% - exit /b %ERRORLEVEL% - ) + goto :output_error ) REM https://stackoverflow.com/questions/61888625/what-is-f-in-the-for-loop-command @@ -32,6 +29,14 @@ for /f "tokens=*" %%i in ('ideasy %IDE_OPTIONS% env') do ( call set %%i ) -if not %ERRORLEVEL% == 0 ( +ideasy %IDE_OPTIONS% env>nul + +if %ERRORLEVEL% == 0 ( echo IDE environment variables have been set for %IDE_HOME% in workspace %WORKSPACE% ) + +:output_error +if not %ERRORLEVEL% == 0 ( + echo %_fBRed%Error: IDEasy failed with exit code %ERRORLEVEL% %_RESET% + exit /b %ERRORLEVEL% +)