Files
sps_skel/bin/setenv.bat
T
m.stangl fce0b8d9a1 Fix BOM breaking bin/*.bat and add early Graphviz check to --tosvg wrappers
setenv.bat (and activate_venv/get_cmd/install_py.bat) had a UTF-8 BOM,
which cmd.exe read as part of the @echo off line, breaking every bin
script that calls setenv.bat via `call`. Stripped the BOM.

material_flow.bat/.sh and tro_flow.bat/.sh now check up front whether
the Graphviz engine --tosvg needs (dot, or neato with --use-cords) is
resolvable, and print an early WARNUNG with fix instructions if not -
before the CSV is even parsed. The Python scripts still run and report
the same failure in detail if the SVG step is actually reached.
2026-08-21 12:08:41 +02:00

66 lines
2.1 KiB
Batchfile

@echo off
REM ================================================================
REM SPS_SKEL - Umgebungsvariablen Setup
REM ================================================================
if defined SKEL_BIN (
echo SPS_SKEL Umgebung bereits gesetzt.
goto :show
)
echo Setting up environment variables for SPS_SKEL ...
REM Basis-Projektpfad (aktueller Ordner)
set "SPS_SKEL=%~dp0.."
if "%SPS_SKEL:~-6%"=="bin\.." set "SPS_SKEL=%SPS_SKEL:~0,-6%"
if "%SPS_SKEL:~-1%"=="\" set "SPS_SKEL=%SPS_SKEL:~0,-1%"
REM Pfade fuer verschiedene Komponenten
set "SKEL_BIN=%SPS_SKEL%\bin"
set "SKEL_LIB=%SPS_SKEL%\lib"
set "SKEL_DATA=%SPS_SKEL%\data"
set "SKEL_DOC=%SPS_SKEL%\doc"
set "SKEL_CFG=%SPS_SKEL%\cfg"
set "SKEL_LOG=%SPS_SKEL%\log"
set "SKEL_TESTS=%SPS_SKEL%\tests"
set "SKEL_RESULTS=%SPS_SKEL%\results"
set "SKEL_EXAMPLES=%SPS_SKEL%\examples"
REM Python-Pfad erweitern (nur wenn noch nicht vorhanden)
echo %PYTHONPATH% | find /i "%SKEL_LIB%" >nul
if errorlevel 1 (
set "PYTHONPATH=%SKEL_LIB%;%PYTHONPATH%"
)
REM Ordner erstellen falls sie nicht existieren
if not exist "%SKEL_BIN%" mkdir "%SKEL_BIN%"
if not exist "%SKEL_CFG%" mkdir "%SKEL_CFG%"
if not exist "%SKEL_LIB%" mkdir "%SKEL_LIB%"
if not exist "%SKEL_DATA%" mkdir "%SKEL_DATA%"
if not exist "%SKEL_LOG%" mkdir "%SKEL_LOG%"
if not exist "%SKEL_RESULTS%" mkdir "%SKEL_RESULTS%"
if not exist "%SKEL_EXAMPLES%" mkdir "%SKEL_EXAMPLES%"
REM Umgebungsvariablen anzeigen
:show
echo.
echo ================================================================
echo SPS_SKEL ENVIRONMENT SETUP COMPLETE
echo ================================================================
echo SPS_SKEL = %SPS_SKEL%
echo SKEL_BIN = %SKEL_BIN%
echo SKEL_CFG = %SKEL_CFG%
echo SKEL_LIB = %SKEL_LIB%
echo SKEL_DATA = %SKEL_DATA%
echo SKEL_DOC = %SKEL_DOC%
echo SKEL_RESULTS = %SKEL_RESULTS%
echo SKEL_LOG = %SKEL_LOG%
echo SKEL_EXAMPLES = %SKEL_EXAMPLES%
echo PYTHONPATH = %PYTHONPATH%
echo ================================================================
echo.
REM Optionally keep window open
if "%1"=="--keep-open" pause