mirror of
https://github.com/joelhooks/joelclaw.git
synced 2026-09-19 01:24:04 +08:00
e21d9c8674
- /adrs — lists all ADRs with status badges (proposed/accepted/superseded) - /adrs/[slug] — renders individual ADR with MDXRemote - scripts/sync-adrs.sh — rsync from ~/Vault/docs/decisions/ → content/adrs/, commit+push - lib/adrs.ts — gray-matter loader for ADR markdown files
33 lines
927 B
Bash
Executable File
33 lines
927 B
Bash
Executable File
#!/bin/bash
|
|
# Sync ADRs from Vault to web content directory.
|
|
# Run via launchd (WatchPaths) or manually: ./scripts/sync-adrs.sh
|
|
#
|
|
# Copies ~/Vault/docs/decisions/*.md → apps/web/content/adrs/
|
|
# Commits and pushes if there are changes.
|
|
|
|
set -euo pipefail
|
|
|
|
VAULT_ADRS="$HOME/Vault/docs/decisions"
|
|
WEB_ADRS="$(dirname "$0")/../apps/web/content/adrs"
|
|
REPO_ROOT="$(dirname "$0")/.."
|
|
|
|
# Ensure target dir exists
|
|
mkdir -p "$WEB_ADRS"
|
|
|
|
# Sync — delete removed ADRs, copy new/updated ones
|
|
rsync -av --delete --include='*.md' --exclude='*' "$VAULT_ADRS/" "$WEB_ADRS/"
|
|
|
|
# Check if anything changed
|
|
cd "$REPO_ROOT"
|
|
if git diff --quiet apps/web/content/adrs/ && [ -z "$(git ls-files --others --exclude-standard apps/web/content/adrs/)" ]; then
|
|
echo "No ADR changes to sync."
|
|
exit 0
|
|
fi
|
|
|
|
# Commit and push
|
|
git add apps/web/content/adrs/
|
|
git commit -m "sync: ADRs from Vault $(date +%Y-%m-%d)"
|
|
git push
|
|
|
|
echo "ADRs synced and pushed."
|