gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain5d144817Merge branch 'records-t40' into mainTicketsmain/tools/sync-components.sh

2.2 KB

  1. #!/usr/bin/env bash
  2. # tools/sync-components.sh — copy the components.hybriel.worldapi.org blocks tickets uses, BYTE-VERBATIM from a commit
  3. # (mission 016; the model is layouts.worldapi.org's tools/sync-components.sh).
  4. # tools/sync-components.sh [commit] copy from <commit> (default: HEAD of the source repo), write components/SOURCE
  5. # tools/sync-components.sh --check compare the copies with the commit in components/SOURCE (exit 1 on any difference)
  6. # Source repo: $COMPONENTS_REPO (default loreana /media/STORAGE/projects/WorldAPI/components.hybriel.worldapi.org). The files come out of
  7. # git (`git show <commit>:<path>`), not the working tree, so uncommitted edits there never land here. Never edit the copies:
  8. # change them in components.hybriel, commit there, run this, then the gates (README "Comments").
  9. set -euo pipefail
  10. APP="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
  11. SRC="${COMPONENTS_REPO:-/media/STORAGE/projects/WorldAPI/components.hybriel.worldapi.org}"
  12. # what is copied: each block's own file + README (no demo.hl). comments.hl imports ../md-editor/md-editor.hl and (mission 017,
  13. # attachments) ../files-upload/files-upload.hl; md-editor and files-upload import ../icons/icons.hl (F4, the shared Icon).
  14. FILES=(
  15. comments/comments.hl comments/README.md
  16. md-editor/md-editor.hl md-editor/README.md
  17. icons/icons.hl icons/README.md
  18. files-upload/files-upload.hl files-upload/README.md
  19. )
  20. # a git worktree has a .git FILE, a clone a .git directory: either is a repo
  21. [ -e "$SRC/.git" ] || { echo "no git repo at $SRC (set COMPONENTS_REPO)"; exit 2; }
  22. if [ "${1:-}" = "--check" ]; then
  23. REF="$(head -n1 "$APP/components/SOURCE" | cut -d' ' -f1)"
  24. bad=0
  25. for f in "${FILES[@]}"; do
  26. if ! git -C "$SRC" show "$REF:components/$f" | cmp -s - "$APP/components/$f"; then echo "DIFFERS: components/$f (vs $REF)"; bad=1; fi
  27. done
  28. [ $bad = 0 ] && echo "verbatim: ${#FILES[@]} files = components.hybriel $REF"
  29. exit $bad
  30. fi
  31. REF="$(git -C "$SRC" rev-parse --short "${1:-HEAD}^{commit}")"
  32. for f in "${FILES[@]}"; do
  33. mkdir -p "$APP/components/$(dirname "$f")"
  34. git -C "$SRC" show "$REF:components/$f" > "$APP/components/$f"
  35. done
  36. echo "$REF $(git -C "$SRC" log -1 --format='%cs %s' "$REF")" > "$APP/components/SOURCE"
  37. echo "copied ${#FILES[@]} files from components.hybriel $REF"
  38. "$0" --check

Branches

Latest commits

  • 5d144817Merge branch 'records-t40' into mainTickets
  • 44ee6f06|||PR records: #43 #45 livemre
  • b8fdeee9Merge branch 'p39-routes' into mainTickets
  • a0187a0a|||PR Remove redundant route-order loopmre
  • 369e4b9cMerge branch 'k40-lists' into mainTickets
  • 9af8e780|||PR Use keyed list mutations for live ticket updatesmre
  • 610d8e8aMerge branch 'records-t39' into mainTickets
  • 32bcdf24|||PR records: GO P39 K40mre
  • 4123c6d1Merge branch 'records-t38' into mainTickets
  • cd3641a1|||PR records: day72 deploy live, tickets closedmre
  • 7d44d852Merge branch 'records-t37' into mainTickets
  • 926f7061|||PR records: merges, D36 deploymre
  • bf58534eMerge branch 'l33-final' into mainTickets
  • 759a9ac3|||PR thin login (tickets#46, #45): merge main, route entry cleanupmre
  • 239436d8Merge remote-tracking branch 'origin/main' into l33-finalmre
  • 5822cb3aMerge branch 'o34-clean' into mainTickets
  • 0870653c|||PR offline note from __hlOnline, no polling (tickets#41)mre
  • 14cf96b4Merge branch 'records-t36' into mainTickets
  • 07749fa1|||PR records: day72 + #40 mergedmre
  • ecd7e226|||PR Consolidate login and move handler logic into topic libraries (partial)mre