#!/usr/bin/env bash # install.sh — dünner Einstiegspunkt, auch per curl|bash lauffähig: # curl -fsSL https://my.linux.town/install.sh | bash # Stellt git sicher, klont oder aktualisiert das Repo und ruft bootstrap.sh. # Hinweis: sourced bewusst NICHT lib/log.sh — die lib existiert vor dem # ersten Klon noch nicht. Erst bootstrap.sh (post-clone) nutzt die lib. set -euo pipefail REPO_URL="${BENS_ARCH_REPO:-ssh://git@git.mamabaer.dev:2222/benedikt/bens-arch.git}" TARGET="${BENS_ARCH_DIR:-$HOME/Projects/own/bens-arch}" echo "[info] bens-arch install" if ! command -v git >/dev/null 2>&1; then echo "[info] git fehlt — installiere via pacman" sudo pacman -S --needed --noconfirm git fi if [[ -d $TARGET/.git ]]; then echo "[info] Repo vorhanden — aktualisiere $TARGET" git -C "$TARGET" pull --ff-only else echo "[info] Klone $REPO_URL nach $TARGET" mkdir -p "$(dirname "$TARGET")" git clone "$REPO_URL" "$TARGET" fi exec "$TARGET/bootstrap.sh" "$@"