apm.yml only declares claude and codex marketplace output profiles -- codex writes a differently-shaped file to .agents/plugins/marketplace.json, so nothing regenerates the legacy Copilot CLI path at .github/plugin/marketplace.json. It was hand-synced once during the #90 conversion and had drifted (missing the category field added when codex output was enabled) with no gate to catch it. scripts/sync-marketplace-mirror.sh keeps it byte-identical to the compiled .claude-plugin/marketplace.json, wired as a pre-push check so it can't go stale silently again. Refs: #90
46 lines
1.5 KiB
Bash
Executable File
46 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# .claude-plugin/marketplace.json is apm's compiled Claude marketplace output (see
|
|
# apm.yml's marketplace.outputs.claude). GitHub Copilot CLI's manifest lookup accepts
|
|
# that same file at .claude-plugin/marketplace.json directly, but also has a legacy
|
|
# convention path at .github/plugin/marketplace.json (see
|
|
# plugins/kyberforge/docs/research/docs/github-copilot-plugins/marketplace.md) -- and
|
|
# CONTEXT.md documents that path as a mirror of the Claude output, not a separate apm
|
|
# output profile (apm only ships "claude" and "codex" mappers; codex writes a
|
|
# differently-shaped file to .agents/plugins/marketplace.json, not this path). This
|
|
# script keeps that legacy mirror byte-identical to .claude-plugin/marketplace.json
|
|
# instead of letting it silently drift (see issue #90 comment thread).
|
|
|
|
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
SRC="$REPO_ROOT/.claude-plugin/marketplace.json"
|
|
DST="$REPO_ROOT/.github/plugin/marketplace.json"
|
|
|
|
usage() {
|
|
echo "Usage: $0 [--check]" >&2
|
|
exit 1
|
|
}
|
|
|
|
CHECK=0
|
|
if [[ "${1:-}" == "--check" ]]; then
|
|
CHECK=1
|
|
shift
|
|
fi
|
|
[[ $# -eq 0 ]] || usage
|
|
|
|
if [[ ! -f "$SRC" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "$CHECK" -eq 1 ]]; then
|
|
if [[ ! -f "$DST" ]] || ! diff -q "$SRC" "$DST" >/dev/null 2>&1; then
|
|
echo "DRIFT $DST: out of sync with .claude-plugin/marketplace.json" >&2
|
|
echo "Fix: bash scripts/sync-marketplace-mirror.sh" >&2
|
|
exit 1
|
|
fi
|
|
exit 0
|
|
fi
|
|
|
|
mkdir -p "$(dirname "$DST")"
|
|
cp "$SRC" "$DST"
|