Skip to content

Commit 3a24512

Browse files
authored
#894: Fix ide.bat printing for initialization and error output (#902)
1 parent ca658ef commit 3a24512

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CHANGELOG.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This file documents all notable changes to https://github.com/devonfw/IDEasy[IDE
66

77
Release with new features and bugfixes:
88

9+
* https://github.com/devonfw/IDEasy/issues/894[#894]: Fix ide.bat printing for initialization and error output
910

1011
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].
1112

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,22 @@ if exist "%GIT_CORE%" (
2121

2222
if not "%1%" == "" (
2323
ideasy %IDE_OPTIONS% %*
24-
if not %ERRORLEVEL% == 0 (
25-
echo %_fBRed%Error: IDEasy failed with exit code %ERRORLEVEL% %_RESET%
26-
exit /b %ERRORLEVEL%
27-
)
24+
goto :output_error
2825
)
2926

3027
REM https://stackoverflow.com/questions/61888625/what-is-f-in-the-for-loop-command
3128
for /f "tokens=*" %%i in ('ideasy %IDE_OPTIONS% env') do (
3229
call set %%i
3330
)
3431

35-
if not %ERRORLEVEL% == 0 (
32+
ideasy %IDE_OPTIONS% env>nul
33+
34+
if %ERRORLEVEL% == 0 (
3635
echo IDE environment variables have been set for %IDE_HOME% in workspace %WORKSPACE%
3736
)
37+
38+
:output_error
39+
if not %ERRORLEVEL% == 0 (
40+
echo %_fBRed%Error: IDEasy failed with exit code %ERRORLEVEL% %_RESET%
41+
exit /b %ERRORLEVEL%
42+
)

0 commit comments

Comments
 (0)