Simplify app git seeding in install.sh

This commit is contained in:
Chris Wanstrath 2026-03-05 20:28:00 -08:00
parent 27860c5e32
commit d3b6d97bb6

View File

@ -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
# 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 ──────────────────────────────────────────────