fce0b8d9a1
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.
51 lines
1.8 KiB
Batchfile
51 lines
1.8 KiB
Batchfile
@echo off
|
|
REM ================================================================
|
|
REM SPS_SKEL - Materialfluss-Graph erzeugen
|
|
REM ================================================================
|
|
REM Aufruf:
|
|
REM bin\material_flow.bat --file export.csv
|
|
REM bin\material_flow.bat --file export.csv --tosvg
|
|
REM
|
|
REM Die CSV-Datei wird in %SKEL_DATA% gesucht, DOT und SVG werden
|
|
REM in %SKEL_RESULTS% abgelegt.
|
|
REM ================================================================
|
|
|
|
setlocal
|
|
|
|
REM Umgebung setzen (SKEL_DATA, SKEL_RESULTS, SKEL_LIB, PYTHONPATH ...)
|
|
call "%~dp0setenv.bat" >nul
|
|
|
|
REM Virtuelle Umgebung nutzen, falls vorhanden
|
|
if exist "%SPS_SKEL%\.venv\Scripts\activate.bat" (
|
|
call "%SPS_SKEL%\.venv\Scripts\activate.bat"
|
|
)
|
|
|
|
REM Python-Interpreter bestimmen (py-Launcher bevorzugt, sonst python)
|
|
set "PY=py"
|
|
py --version >nul 2>&1 || set "PY=python"
|
|
|
|
REM Graphviz pruefen, wenn --tosvg SVG erzeugen soll (dot, bei --use-cords/
|
|
REM --use-coords neato) - nur ein frueher Hinweis; das eigentliche Skript
|
|
REM meldet denselben Fehler beim Rendern noch einmal im Detail.
|
|
set "GV_ENGINE=dot"
|
|
echo %*| findstr /i /c:"--use-cords" /c:"--use-coords" >nul && set "GV_ENGINE=neato"
|
|
echo %*| findstr /i /c:"--tosvg" >nul
|
|
if not errorlevel 1 (
|
|
where %GV_ENGINE%.exe >nul 2>&1
|
|
if errorlevel 1 (
|
|
set "GV_OK="
|
|
if /i "%GV_ENGINE%"=="dot" if defined GRAPHVIZ_DOT set "GV_OK=1"
|
|
if not defined GV_OK (
|
|
echo WARNUNG: Graphviz '%GV_ENGINE%' nicht im PATH gefunden - --tosvg wird vermutlich fehlschlagen.
|
|
echo Graphviz installieren ^(https://graphviz.org/download/^), den bin-Ordner
|
|
echo zum PATH hinzufuegen, oder GRAPHVIZ_DOT auf die dot.exe setzen ^(nur fuer 'dot'^).
|
|
echo.
|
|
)
|
|
)
|
|
)
|
|
|
|
"%PY%" "%SKEL_LIB%\material_flow.py" %*
|
|
set "RC=%ERRORLEVEL%"
|
|
|
|
endlocal & exit /b %RC%
|