gitoria

jukebox

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit273494e2273494e2STATUS rewrittenmre273494e2/tools/sync-components.sh

2.7 KB

  1. #!/usr/bin/env bash
  2. # tools/sync-components.sh — copy the components.hybriel.worldapi.org blocks jukebox uses, BYTE-VERBATIM from a commit
  3. # (mission JB2; the model is layouts.worldapi.org's tools/sync-components.sh).
  4. # tools/sync-components.sh [46fefaa] copy pinned icons and the player (c96709c); retain virtual list
  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 "Files").
  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: the media player, the virtual list and the icons: each block own file + README (no demo.hl).
  13. FILES=(
  14. media-player/media-player.hl media-player/README.md
  15. virtual-list/virtual-list.hl virtual-list/README.md
  16. icons/icons.hl icons/README.md
  17. )
  18. # a git worktree has a .git FILE, a clone a .git directory: either is a repo
  19. [ -e "$SRC/.git" ] || { echo "no git repo at $SRC (set COMPONENTS_REPO)"; exit 2; }
  20. if [ "${1:-}" = "--check" ]; then
  21. REF="$(head -n1 "$APP/components/SOURCE" | cut -d' ' -f1)"
  22. bad=0
  23. for f in "${FILES[@]}"; do
  24. repo="$SRC"
  25. ref="$REF"
  26. case "$f" in
  27. icons/*) ref="46fefaa" ;;
  28. media-player/*) ref="c96709c" ;;
  29. virtual-list/*) ref="46d90ec" ;;
  30. esac
  31. if ! git -C "$repo" show "$ref:components/$f" | cmp -s - "$APP/components/$f"; then echo "DIFFERS: components/$f (vs $ref)"; bad=1; fi
  32. done
  33. [ $bad = 0 ] && echo "verbatim: icons 46fefaa; virtual-list 46d90ec; media-player c96709c (${#FILES[@]} files)"
  34. exit $bad
  35. fi
  36. REF="$(git -C "$SRC" rev-parse --short "${1:-46fefaa}^{commit}")"
  37. [ "$REF" = "46fefaa" ] || { echo "icons are pinned to 46fefaa; update the provenance check before changing the pin"; exit 2; }
  38. for f in icons/icons.hl icons/README.md; do
  39. mkdir -p "$APP/components/$(dirname "$f")"
  40. git -C "$SRC" show "$REF:components/$f" > "$APP/components/$f"
  41. done
  42. printf '46d90ec virtual-list from components.hybriel\n46fefaa icons from components.hybriel\nc96709c media-player from components.hybriel (skip and repeat options)\n' > "$APP/components/SOURCE"
  43. for f in media-player/media-player.hl media-player/README.md; do
  44. mkdir -p "$APP/components/$(dirname "$f")"
  45. git -C "$SRC" show "c96709c:components/$f" > "$APP/components/$f"
  46. done
  47. echo "copied 2 icon files from components.hybriel $REF and 2 media-player files from c96709c; retained virtual list"
  48. "$0" --check

Branches

Latest commits

  • 273494e2STATUS rewrittenmre
  • 227c9b96Records: jb19 livemre
  • 9f365376README: the bar's controls (jb19)mre
  • d18851fdjb19: pressed switches look different (whole selector), queue column cannot widen past the panel, gates follow the new bar (jb3, jb11, jb15)mre
  • 82b54c0ejb19: bar Shuffle · Previous · Play · Next · Repeat, no 10 s buttons; Shuffle switch (shuffle from the playing song, back to the list), Repeat off/all/one, both remembered in ui.json; Shuffle my favourites an ordinary button; gate tests/jb19.mjsmre
  • ba354710jb19: icons pinned to components.hybriel 46fefaa (shuffle, repeat, repeatOne, prevTrack, nextTrack)mre
  • d8e8d059jb19 step 2: media-player from components.hybriel c96709c (skip, repeat options; the end of a song only calls onPlay), sync-components.sh and SOURCE point to it, jb11 counts media loads and metadata writes (from jb21 d3a026e)mre
  • 7b048c1bRecords: jb19 done, L2 live stepmre
  • 665185aeMission 009: jb19 livemre
  • 47b2d3beRecords: P1 resumedmre
  • 8e326e94Records: resetKey blockedmre
  • f72dd7edRecords: icons comingmre
  • b264e5deRecords: P1 icons stopmre
  • 514d7cbeRecords: mission 008 startedmre
  • 61c40127Mission 008: #19 + #21mre
  • 6dcaeb46Records: resetKey planmre
  • c5dbf2ecRecords: R2 resultmre
  • 956069b8Records: R1 result, mission 007mre
  • 3c8a2e12Mission 007: #20 sort scrollmre
  • deb8cef5Records: mission 006 startedmre