mirror of
https://github.com/gnekt/My-Brain-Is-Full-Crew.git
synced 2026-09-13 09:16:46 +00:00
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
This commit is contained in:
@@ -85,6 +85,12 @@ should_include() {
|
||||
# parse_hook_yaml <hook_yaml_file>
|
||||
# Emits key=value lines for each top-level scalar AND for trigger fields.
|
||||
# Output keys: name, script, event, match-tool (space-separated tokens), exclude.
|
||||
#
|
||||
# NOTE: This flattens all triggers into a single stream. When a hook has
|
||||
# multiple triggers, the association between event and match-tool is lost.
|
||||
# Currently all hooks use a single trigger, so this is not an issue in
|
||||
# practice. If multi-trigger hooks are needed, this output format must be
|
||||
# changed to emit delimited records (one per trigger).
|
||||
parse_hook_yaml() {
|
||||
local file="$1"
|
||||
awk '
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
# adapters/opencode/config-merge.sh — JSON config merge for opencode.json
|
||||
# =============================================================================
|
||||
# Merges a built opencode.json with an existing one in the vault, preserving
|
||||
# user keys and formatting. Only the "mcp" key is managed; everything else
|
||||
# belongs to the user.
|
||||
# user keys and indentation style (2-space, 4-space, or tab). Only the "mcp"
|
||||
# key is managed; everything else belongs to the user. Note: jq normalizes
|
||||
# whitespace and may reorder keys within objects.
|
||||
#
|
||||
# Sourced by the opencode adapter. Requires jq.
|
||||
# =============================================================================
|
||||
|
||||
@@ -15,7 +15,13 @@ DIST_DIR="$REPO_DIR/dist/claude-code"
|
||||
# Replace snapshot with current build output
|
||||
rm -rf "$SNAPSHOT_DIR"
|
||||
mkdir -p "$SNAPSHOT_DIR"
|
||||
cp -r "$DIST_DIR"/* "$DIST_DIR"/.claude "$DIST_DIR"/.mcp.json "$SNAPSHOT_DIR/" 2>/dev/null || true
|
||||
|
||||
# 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"
|
||||
|
||||
Reference in New Issue
Block a user