gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commita3e74c8aa3e74c8alayouts mission 002 1/3: components re-copied byte-verbatim from components.hybriel 3f93d71 by tools/sync-components.sh (+ --check, components/SOURCE); gate 73/0, check-theme 0mrea3e74c8a/tools/sync-components.sh

2.1 KB

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

Branches

Latest commits

  • a3e74c8alayouts mission 002 1/3: components re-copied byte-verbatim from components.hybriel 3f93d71 by tools/sync-components.sh (+ --check, components/SOURCE); gate 73/0, check-theme 0mre
  • 80ce6ba9report 001 (mission 075)mre
  • 5c6e338flayouts.worldapi.org in Hybriel: WorldAPI theme (tokens, borderless elements, themed components.hybriel components), shells (header, main/user menu, sidebar overlay, content-first, list-first, three-pane), showcase, check-theme helper; gate 73/0 (mission 075)mre