feat(scrape): sync GUI bridge doc into linux-x64 folder

Add sync-gui-bridge-doc.sh to copy the versioned bridge markdown beside
the GUI zip; includes offline smoke test (18 total via run-all-smokes).
This commit is contained in:
Boden 2026-05-29 16:10:17 -05:00
parent 9c22a3efee
commit 3fd42d924e
5 changed files with 114 additions and 2 deletions

View file

@ -7,7 +7,7 @@ DiscordChatExporter.linux-x64/ ← GUI (this folder)
DiscordChatExporter/ ← source repo (scripts, Docker, config)
```
Copy this file to `../DiscordChatExporter.linux-x64/RECURRING-SCRAPE.md` if you want the quick reference next to the GUI binary.
Sync to the GUI zip folder: `./scripts/sync-gui-bridge-doc.sh` (writes `../DiscordChatExporter.linux-x64/RECURRING-SCRAPE.md` by default).
## Quick start (run from source repo)

View file

@ -0,0 +1,28 @@
---
title: feat: Sync GUI zip bridge doc from source repo
type: feat
status: complete
date: 2026-05-29
origin: /lfg — plan 013/019 planned sync-workspace-bridge.sh; bridge doc now versioned in git
---
# feat: Sync GUI zip bridge doc from source repo
## Summary
Add `scripts/sync-gui-bridge-doc.sh` to copy `docs/gui-zip-recurring-scrape-bridge.md` into the sibling GUI zip folder as `RECURRING-SCRAPE.md`, with a smoke test using a temp destination.
## Requirements
| ID | Requirement |
|----|-------------|
| R1 | `sync-gui-bridge-doc.sh` copies bridge doc to configurable dest (default `../DiscordChatExporter.linux-x64/RECURRING-SCRAPE.md`) |
| R2 | `--dry-run` prints source and destination |
| R3 | `sync-gui-bridge-doc-smoke.sh` verifies copy into temp dir |
| R4 | Operator checklist and gui bridge doc mention the sync script |
| R5 | `run-all-smokes.sh` passes |
## Verification
- `./scripts/tests/sync-gui-bridge-doc-smoke.sh`
- `DCE_MIN_FREE_MB=0 ./scripts/run-all-smokes.sh`

View file

@ -33,7 +33,7 @@ Installed jobs are marked `# BEGIN discord-scrape` in `crontab -l`. Logs append
## GUI zip only
See [gui-zip-recurring-scrape-bridge.md](gui-zip-recurring-scrape-bridge.md) or run `../DiscordChatExporter.linux-x64/bootstrap-recurring-scrape.sh`.
See [gui-zip-recurring-scrape-bridge.md](gui-zip-recurring-scrape-bridge.md), run `./scripts/sync-gui-bridge-doc.sh`, or use `../DiscordChatExporter.linux-x64/bootstrap-recurring-scrape.sh`.
Validate scripts after changes:

63
scripts/sync-gui-bridge-doc.sh Executable file
View file

@ -0,0 +1,63 @@
#!/usr/bin/env bash
set -Eeuo pipefail
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)
REPO_ROOT="${DCE_REPO_ROOT:-$(cd "$SCRIPT_DIR/.." && pwd -P)}"
SOURCE_DOC="$REPO_ROOT/docs/gui-zip-recurring-scrape-bridge.md"
DEFAULT_DEST="$REPO_ROOT/../DiscordChatExporter.linux-x64/RECURRING-SCRAPE.md"
DEST_PATH="${DCE_GUI_BRIDGE_DEST:-$DEFAULT_DEST}"
DRY_RUN=0
usage() {
cat <<EOF
Usage:
$(basename "$0") [--dest PATH] [--dry-run]
Copy the versioned GUI zip quick-start from docs/gui-zip-recurring-scrape-bridge.md
to the sibling GUI folder (default: ../DiscordChatExporter.linux-x64/RECURRING-SCRAPE.md).
EOF
}
die() {
printf 'ERROR: %s\n' "$*" >&2
exit 1
}
main() {
while (($#)); do
case "$1" in
--dest)
[[ $# -ge 2 ]] || die "Missing value for --dest."
DEST_PATH=$2
shift 2
;;
--dry-run)
DRY_RUN=1
shift
;;
--help|-h)
usage
exit 0
;;
*)
die "Unknown option: $1"
;;
esac
done
[[ -f "$SOURCE_DOC" ]] || die "Missing source doc: $SOURCE_DOC"
local dest_dir
dest_dir=$(dirname "$DEST_PATH")
[[ -d "$dest_dir" ]] || die "Destination directory does not exist: $dest_dir (create it or pass --dest)"
if (( DRY_RUN == 1 )); then
printf 'Would copy:\n %s\n -> %s\n' "$SOURCE_DOC" "$DEST_PATH"
exit 0
fi
cp -f "$SOURCE_DOC" "$DEST_PATH"
printf 'Synced GUI bridge doc to %s\n' "$DEST_PATH"
}
main "$@"

View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -Eeuo pipefail
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)
SYNC="$REPO_ROOT/scripts/sync-gui-bridge-doc.sh"
TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/dce-bridge-sync-smoke.XXXXXX")
DEST="$TMP_DIR/gui-zip/RECURRING-SCRAPE.md"
cleanup() {
rm -rf "$TMP_DIR"
}
trap cleanup EXIT
mkdir -p "$TMP_DIR/gui-zip"
"$SYNC" --dest "$DEST"
[[ -f "$DEST" ]] || { printf 'ERROR: dest missing\n' >&2; exit 1; }
grep -q 'operator-handoff' "$DEST" || { printf 'ERROR: dest content unexpected\n' >&2; exit 1; }
printf 'sync-gui-bridge-doc-smoke: ok\n'