tv-anarchy/tools/stamp-build.sh
Natalie 92b38b1bae refactor(tv-anarchy): rename PlumTV→TVAnarchy and land session work
Renames Sources/PlumTV→TVAnarchy and PlumTVCore→TVAnarchyCore (the rename
the auto-commit service couldn't stage — it git-add'd the old, now-gone
paths and aborted every cycle), and commits the accumulated work:

- Library: black-built index fast path (LibraryIndex + scanFromIndex) with
  NFS-walk fallback; incremental --add on download-complete; mtime staleness
  gate; loose-file series-collapse fix; determinate scan/index progress.
- Cover art: keyless TVmaze cartoon-vs-live-action disambiguation (type/year).
- Player: sleep timer (timed + end-of-episode); visibility-gated polling.
- Home: Continue Watching cover art + live refresh; Recently Added; adult gate.
- Logs: multi-line selection + copy; truncated giant tx-list errors.
- Hover previews (opt-in) via black ffmpeg + scp.

Also gitignores foreign project trees (governor/mcp/fleet/recommender) that
sit in this directory but belong to their own repos.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 22:04:22 -07:00

27 lines
1.2 KiB
Bash
Executable file

#!/usr/bin/env bash
# Write Sources/TVAnarchyCore/BuildStamp.swift from the current git state. Run
# this BEFORE `xcodegen generate` (build-install.sh does) so the constant is
# globbed into the project and compiled into the app. The file is gitignored —
# it changes every build and must never churn the repo. A compiled constant is
# the reliable home for the stamp: unlike a post-build Info.plist edit, it can't
# be silently dropped by Xcode's build-phase ordering.
set -euo pipefail
cd "$(dirname "$0")/.."
SHA=$(git rev-parse --short HEAD 2>/dev/null || echo nogit)
[ -n "$(git status --porcelain 2>/dev/null)" ] && SHA="${SHA}-dirty"
COUNT=$(git rev-list --count HEAD 2>/dev/null || echo 0)
STAMP=$(date "+%Y-%m-%d %H:%M:%S")
OUT="Sources/TVAnarchyCore/BuildStamp.swift"
cat > "$OUT" <<EOF
// GENERATED by tools/stamp-build.sh — do not edit, gitignored.
// Build identity baked into the binary so the running app can show exactly which
// commit + build it came from (see AppVersion / the sidebar stamp).
enum BuildStamp {
static let sha = "${SHA}"
static let commitCount = ${COUNT}
static let buildTime = "${STAMP}"
}
EOF
echo "stamped $OUT → build ${COUNT} (${SHA}) @ ${STAMP}"