From 200145eea75abb7d2489374bf5d6216a785db246 Mon Sep 17 00:00:00 2001 From: mistangl Date: Wed, 28 Jan 2026 18:36:14 +0100 Subject: [PATCH] =?UTF-8?q?errorlevel=20wurde=20nicht=20korrekt=20zur?= =?UTF-8?q?=C3=BCckgemeldet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/create_alltests.bat | 20 ++++++++++++++++---- bin/plant2dxf.bat | 20 ++++++++++++++++---- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/bin/create_alltests.bat b/bin/create_alltests.bat index fc8cda4..39b9210 100644 --- a/bin/create_alltests.bat +++ b/bin/create_alltests.bat @@ -7,13 +7,17 @@ echo Output directory: %PROJECT_WORK% echo ======================================== echo. +REM Track if any errors occurred +set ERRORS_OCCURRED=0 + REM Iterate through all CSV files in testdata directory -for %%f in (%PROJECT_TEST%\*.csv) do ( +for %%f in ("%PROJECT_TEST%\*.csv") do ( echo Processing: %%~nxf CALL plant2dxf.bat -f "%%f" -o "%PROJECT_WORK%\%%~nf.dxf" if errorlevel 1 ( echo ERROR: Failed to process %%~nxf echo. + set ERRORS_OCCURRED=1 ) else ( echo SUCCESS: Created %%~nf.dxf in work folder echo. @@ -21,6 +25,14 @@ for %%f in (%PROJECT_TEST%\*.csv) do ( ) echo ======================================== -echo All test DXF files processed! -echo ======================================== -pause +if %ERRORS_OCCURRED%==1 ( + echo Processing completed with ERRORS! + echo ======================================== + pause + exit /b 1 +) else ( + echo All test DXF files processed successfully! + echo ======================================== + pause + exit /b 0 +) diff --git a/bin/plant2dxf.bat b/bin/plant2dxf.bat index 6e518f0..e1816ee 100644 --- a/bin/plant2dxf.bat +++ b/bin/plant2dxf.bat @@ -1,6 +1,18 @@ @echo off -CALL manage_interpreter.bat activate_interpreter -cd /d %PROJECT% +CALL manage_interpreter.bat activate +if errorlevel 1 ( + echo ERROR: Failed to activate Python environment + exit /b 1 +) + +cd /d "%PROJECT%" +if errorlevel 1 ( + echo ERROR: Failed to change to project directory: %PROJECT% + exit /b 1 +) + "%VIRTUAL_ENV%\Scripts\python.exe" -m lib.plant2dxf %* -CALL manage_interpreter.bat deactivate_interpreter -exit /b %ERRORLEVEL% +set PYTHON_EXIT=%ERRORLEVEL% + +CALL manage_interpreter.bat deactivate +exit /b %PYTHON_EXIT%