From 3a245126630e4ad7240923efbca733751ffcac15 Mon Sep 17 00:00:00 2001 From: alfeilex <101652401+alfeilex@users.noreply.github.com> Date: Tue, 7 Jan 2025 18:21:21 +0100 Subject: [PATCH] #894: Fix ide.bat printing for initialization and error output (#902) --- CHANGELOG.adoc | 1 + cli/src/main/package/bin/ide.bat | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 12ed4f6de..0d561169b 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% +)