From d3b6d97bb614bc6973d1f5675cf21a2a8de12e7d Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Thu, 5 Mar 2026 20:28:00 -0800 Subject: [PATCH] Simplify app git seeding in install.sh --- install/install.sh | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/install/install.sh b/install/install.sh index 44f0588..85f66c0 100644 --- a/install/install.sh +++ b/install/install.sh @@ -80,7 +80,7 @@ info "Installing dependencies" quiet bun install info "Building" -rm -rf dist +rm -rf "$DEST/dist" quiet bun run build # ── Bundled apps ───────────────────────────────────────── @@ -94,23 +94,20 @@ for app_dir in "$DEST"/apps/*/; do [ -f "$app_dir/package.json" ] || continue echo " $app" cp -a "$app_dir" "$APPS_DIR/$app" - if [ -f "$APPS_DIR/$app/package.json" ]; then - quiet bun install --frozen-lockfile --cwd "$APPS_DIR/$app" || quiet bun install --cwd "$APPS_DIR/$app" - fi + quiet bun install --frozen-lockfile --cwd "$APPS_DIR/$app" || quiet bun install --cwd "$APPS_DIR/$app" - # Initialize bare repo for git-based versioning + # Seed bare repo for git-based versioning bare="$REPOS_DIR/$app.git" - if [ ! -d "$bare" ]; then - quiet git init --bare -b main "$bare" - git -C "$bare" config http.receivepack true + quiet git -C "$APPS_DIR/$app" init -b main + quiet git -C "$APPS_DIR/$app" add -A + quiet git -C "$APPS_DIR/$app" -c user.name=toes -c user.email=toes@localhost commit -m "install" + if [ -d "$bare" ]; then + quiet git -C "$APPS_DIR/$app" push --force "$bare" main + else + quiet git clone --bare "$APPS_DIR/$app" "$bare" + quiet git -C "$bare" config http.receivepack true fi - tmp=$(mktemp -d) - cp -a "$app_dir"/. "$tmp"/ - quiet git -C "$tmp" init -b main - quiet git -C "$tmp" add -A - quiet git -C "$tmp" -c user.name=toes -c user.email=toes@localhost commit -m "install" - quiet git -C "$tmp" push --force "$bare" main - rm -rf "$tmp" + rm -rf "$APPS_DIR/$app/.git" done # ── Systemd ──────────────────────────────────────────────