mirror of
https://github.com/joelhooks/joelclaw.git
synced 2026-09-19 01:24:04 +08:00
016dccc295
- Titles wrap fully instead of truncating - Relevance text shows complete (no line-clamp) - Date shown as relative time (2d ago) above title, not stealing width - Single type badge (repo/article/video) replaces full tag list - Source URL removed from index (shown on detail page) - Tighter card spacing for better scan density - Re-removed duplicate self-hosting discovery (also from Vault source)
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."
|