diff --git a/install.sh b/install.sh index 4c8a853..c08b37b 100755 --- a/install.sh +++ b/install.sh @@ -313,7 +313,14 @@ resolve_component_path() { registry_key=$(get_registry_key "$component_type") if [ "$component_type" = "context" ] && [[ "$component_id" == */* ]]; then - jq_exec "first(.components.contexts[]? | select(.path == \".opencode/context/${component_id}.md\") | .path)" "$TEMP_DIR/registry.json" + # Try .md extension first (most context files), then fall back to the + # path as-is for non-markdown files (e.g. paths.json). Fixes #251. + local result + result=$(jq_exec "first(.components.contexts[]? | select(.path == \".opencode/context/${component_id}.md\") | .path)" "$TEMP_DIR/registry.json") + if [ -z "$result" ] || [ "$result" = "null" ]; then + result=$(jq_exec "first(.components.contexts[]? | select(.path == \".opencode/context/${component_id}\") | .path)" "$TEMP_DIR/registry.json") + fi + echo "$result" return fi diff --git a/plugins/claude-code/scripts/install-context.sh b/plugins/claude-code/scripts/install-context.sh index 9c6b1e9..34cc2ba 100755 --- a/plugins/claude-code/scripts/install-context.sh +++ b/plugins/claude-code/scripts/install-context.sh @@ -72,7 +72,8 @@ check_dependencies() { } download_context() { - local categories=($1) + local categories + read -ra categories <<< "$1" local temp_dir temp_dir="$(mktemp -d)" # shellcheck disable=SC2064 @@ -113,7 +114,8 @@ download_context() { write_manifest() { local profile="$1" - local categories=($2) + local categories + read -ra categories <<< "$2" local commit="$3" local timestamp timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")