Separation as Tool

This commit is contained in:
2026-07-11 13:43:52 +02:00
commit f542382e58
80 changed files with 5863 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
# GCBoK.WebStaticBuilder — KMU-Installationsskript
# Installiert das Tool nach /opt/GitCover/webstatic und legt einen Symlink
# `webstatic` nach /usr/local/bin. Idempotent.
set -euo pipefail
INSTALL_DIR="${WEBSTATIC_INSTALL_DIR:-/opt/GitCover/webstatic}"
BIN_LINK="/usr/local/bin/webstatic"
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "== GCBoK.WebStaticBuilder Installer =="
echo "Installationsziel: $INSTALL_DIR"
# 1) .NET 10 pruefen
if ! command -v dotnet >/dev/null 2>&1; then
echo "FEHLER: .NET 10 (dotnet) ist nicht installiert." >&2
echo "Installiere .NET 10 von https://dotnet.microsoft.com/download" >&2
exit 1
fi
DOTNET_VER="$(dotnet --version 2>/dev/null || echo 0)"
echo "Gefunden: dotnet $DOTNET_VER"
# 2) Projekt bauen (Release)
echo "== Baue Release =="
dotnet build "$REPO_DIR/GCBoK.WebStaticBuilder.csproj" -c Release -v minimal
# 3) Nach /opt kopieren
echo "== Kopiere nach $INSTALL_DIR =="
mkdir -p "$INSTALL_DIR"
rm -rf "$INSTALL_DIR/bin" "$INSTALL_DIR/webstatic.example" 2>/dev/null || true
cp -r "$REPO_DIR/bin/Release/net10.0/." "$INSTALL_DIR/"
cp -r "$REPO_DIR/webstatic.example" "$INSTALL_DIR/webstatic.example" 2>/dev/null || true
# Hilfsdateien auf oberster Ebene mitnehmen (LICENSE, README, docs)
for f in LICENSE README.md docs plans AGENTS.md MEMORY.md SKILLS.md; do
[ -e "$REPO_DIR/$f" ] && cp -r "$REPO_DIR/$f" "$INSTALL_DIR/" 2>/dev/null || true
done
# 4) Symlink
echo "== Verknuepfe $BIN_LINK -> $INSTALL_DIR/webstatic.dll =="
if [ -w "$(dirname "$BIN_LINK")" ]; then
ln -sf "$INSTALL_DIR/webstatic.dll" "$BIN_LINK"
else
echo "Hinweis: $BIN_LINK benoetigt Schreibrechte; erstelle Link via sudo."
sudo ln -sf "$INSTALL_DIR/webstatic.dll" "$BIN_LINK"
fi
echo ""
echo "Fertig. Danach verfuegbar ueber: webstatic --help"
echo "Beispiel-Seite erzeugen: webstatic init mysite && cd mysite && webstatic build --env work"
echo "Umgebungsvariable (optional): WEBSTATIC_BUILDER=$INSTALL_DIR/webstatic.dll"