Files
My-Brain-Is-Full-Crew/tests/regression/take-snapshot.sh
nunziati 02876784a8 fix: address Copilot review round 2
- config-merge.sh: reword comment to only promise indentation preservation (not full formatting)
- take-snapshot.sh: copy required artifacts explicitly, optional ones with existence check
- adapters/lib.sh: document parse_hook_yaml single-trigger limitation
2026-04-10 20:45:18 +00:00

33 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Captures the build output of the claude-code adapter into tests/regression/snapshot/.
# Run this to update the snapshot after intentional changes to source files or adapters.
set -eo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
SNAPSHOT_DIR="$SCRIPT_DIR/snapshot"
# Build the claude-code adapter
bash "$REPO_DIR/scripts/build.sh" --platform claude-code
DIST_DIR="$REPO_DIR/dist/claude-code"
[[ -d "$DIST_DIR" ]] || { echo "Build did not produce $DIST_DIR"; exit 1; }
# Replace snapshot with current build output
rm -rf "$SNAPSHOT_DIR"
mkdir -p "$SNAPSHOT_DIR"
# Required artifacts — fail loudly if missing
cp -r "$DIST_DIR/.claude" "$SNAPSHOT_DIR/.claude"
cp "$DIST_DIR/CLAUDE.md" "$SNAPSHOT_DIR/CLAUDE.md"
# Optional artifacts — copy if present
[[ -f "$DIST_DIR/.mcp.json" ]] && cp "$DIST_DIR/.mcp.json" "$SNAPSHOT_DIR/.mcp.json"
# Remove non-deterministic / install-only artifacts
rm -f "$SNAPSHOT_DIR/.claude/.mbifc-manifest"
rm -rf "$SNAPSHOT_DIR/.claude-plugin"
echo "Snapshot saved to $SNAPSHOT_DIR"
echo "Files:"
(cd "$SNAPSHOT_DIR" && find . -type f | sort)