forked from defunkt/toes
Simplify app git seeding in install.sh
This commit is contained in:
parent
27860c5e32
commit
d3b6d97bb6
|
|
@ -80,7 +80,7 @@ info "Installing dependencies"
|
||||||
quiet bun install
|
quiet bun install
|
||||||
|
|
||||||
info "Building"
|
info "Building"
|
||||||
rm -rf dist
|
rm -rf "$DEST/dist"
|
||||||
quiet bun run build
|
quiet bun run build
|
||||||
|
|
||||||
# ── Bundled apps ─────────────────────────────────────────
|
# ── Bundled apps ─────────────────────────────────────────
|
||||||
|
|
@ -94,23 +94,20 @@ for app_dir in "$DEST"/apps/*/; do
|
||||||
[ -f "$app_dir/package.json" ] || continue
|
[ -f "$app_dir/package.json" ] || continue
|
||||||
echo " $app"
|
echo " $app"
|
||||||
cp -a "$app_dir" "$APPS_DIR/$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"
|
||||||
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"
|
bare="$REPOS_DIR/$app.git"
|
||||||
if [ ! -d "$bare" ]; then
|
quiet git -C "$APPS_DIR/$app" init -b main
|
||||||
quiet git init --bare -b main "$bare"
|
quiet git -C "$APPS_DIR/$app" add -A
|
||||||
git -C "$bare" config http.receivepack true
|
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
|
fi
|
||||||
tmp=$(mktemp -d)
|
rm -rf "$APPS_DIR/$app/.git"
|
||||||
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"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# ── Systemd ──────────────────────────────────────────────
|
# ── Systemd ──────────────────────────────────────────────
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user