Skip to content

Commit 47ee5a6

Browse files
committed
fix(install.sh): handle both singular and plural component type formats
The get_registry_key() function was always adding 's' to the type, causing 'contexts' to become 'contextss' which doesn't exist in registry.json. Now handles: - Singular forms: context → contexts, agent → agents, skill → skills - Plural forms: contexts → contexts (unchanged), agents → agents - Config stays singular - Fallback for any type ending in 's' Fixes #257
1 parent 3f0d032 commit 47ee5a6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

install.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,19 @@ resolve_component_path() {
323323
# Helper function to get the correct registry key for a component type
324324
get_registry_key() {
325325
local type=$1
326-
# Most types are pluralized, but 'config' stays singular
326+
# Handle both singular and plural forms
327+
# Registry uses plural keys: agents, contexts, skills
327328
case "$type" in
328329
config) echo "config" ;;
330+
# Already plural forms - use as-is
331+
agents|contexts|skills) echo "$type" ;;
332+
# Singular forms - pluralize them
333+
agent) echo "agents" ;;
334+
context) echo "contexts" ;;
335+
skill) echo "skills" ;;
336+
# Fallback: if already ends with 's', assume plural
337+
*s) echo "$type" ;;
338+
# Default: add 's' to make plural
329339
*) echo "${type}s" ;;
330340
esac
331341
}

0 commit comments

Comments
 (0)