35 lines
1.1 KiB
Bash
35 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
# ================================================================
|
|
# SPS_SKEL - FB_Main-Geruest als SCL erzeugen
|
|
# ================================================================
|
|
# Aufruf:
|
|
# bash bin/scl_skeleton.sh
|
|
# bash bin/scl_skeleton.sh --json export_tro.json
|
|
# bash bin/scl_skeleton.sh --json export_tro.json --out FB_Main.scl
|
|
#
|
|
# Die JSON-Datei wird in $SKEL_RESULTS gesucht, die SCL-Datei wird
|
|
# ebenfalls dort abgelegt.
|
|
#
|
|
# Vorstufe: bin/tro_extract.sh (Zeichnung -> JSON)
|
|
# ================================================================
|
|
|
|
set -eu
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
# Umgebung setzen (SKEL_DATA, SKEL_RESULTS, SKEL_LIB, PYTHONPATH ...)
|
|
# shellcheck source=/dev/null
|
|
. "$SCRIPT_DIR/setenv.sh" >/dev/null
|
|
|
|
# Virtuelle Umgebung nutzen, falls vorhanden (pydantic wird benoetigt)
|
|
if [ -f "$SPS_SKEL/.venv/bin/activate" ]; then
|
|
# shellcheck source=/dev/null
|
|
. "$SPS_SKEL/.venv/bin/activate"
|
|
fi
|
|
|
|
# Python-Interpreter bestimmen
|
|
PY="python3"
|
|
command -v python3 >/dev/null 2>&1 || PY="python"
|
|
|
|
exec "$PY" "$SKEL_LIB/scl_skeleton.py" "$@"
|