Skip to content

Skills module usage#23

Draft
heyAyushh wants to merge 3 commits intomainfrom
cursor/skills-module-usage-c501
Draft

Skills module usage#23
heyAyushh wants to merge 3 commits intomainfrom
cursor/skills-module-usage-c501

Conversation

@heyAyushh
Copy link
Copy Markdown
Owner

Fix install.sh to correctly handle IFS for space-based word-splitting in category detection and installation.

The installer's global IFS=$'\n\t' setting prevented correct word-splitting on spaces in is_category_supported and get_available_categories, causing non-interactive installations to fail with "error: no supported categories". This PR saves and restores IFS around affected loops and printf calls to ensure proper array iteration and string joining.


Open in Cursor Open in Web

The installer sets IFS=$'\n\t' globally (line 3) which removes space
from the field separator. This broke two code paths:

1. is_category_supported(): 'for item in ${supported}' treated the
   entire space-delimited string as a single token, so every category
   comparison failed.

2. get_available_categories(): 'for editor in ${SELECTED_EDITORS}'
   failed to iterate over multiple editors, and printf with
   ${available[*]} joined array elements with newline instead of space,
   causing the caller's 'IFS=" " read -r -a' to only capture the
   first element.

Fix by saving/restoring IFS around space-dependent loops and the
final printf in get_available_categories().

Co-authored-by: Ayush <Ayush-15@live.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Feb 6, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stacc Ready Ready Preview, Comment Feb 6, 2026 11:55am

…_fallback

The AWK code in extract_mcp_keys_fallback() used 'in' as a variable
name, but 'in' is a reserved keyword in AWK (used in 'for (key in
array)' expressions). This caused a syntax error for users without jq:

  awk: line 2: syntax error at or near in

Rename the variable to 'inside' throughout the function.

Also fix a pre-existing substr offset bug in the same function: the
regex matched the full '"key": {' pattern but RLENGTH - 3 didn't
correctly strip the closing quote and colon, producing keys like
'shadcn":' instead of 'shadcn'. Simplify by matching just the quoted
key ('"[^"]+"') and using RLENGTH - 2.

Co-authored-by: Ayush <Ayush-15@live.com>
…allback

build_codex_mcp_block_fallback() used match(str, re, array) with a
third argument to capture groups, which is a gawk extension. On macOS
(which ships BSD awk), this causes a syntax error, breaking Codex MCP
config generation for users without gawk installed.

Replace all 8 instances of 3-arg match() with POSIX-compatible
helpers:
- extract_quoted(): matches the first quoted string and returns its
  content via 2-arg match() + substr()
- extract_json_val(): strips key/colon prefix and trailing quote from
  a JSON "key": "value" line using sub()

Also fix:
- Spurious [mcp_servers.mcpServers] TOML block: the "mcpServers"
  detection rule fell through to the key extraction rule on the same
  line; add 'next' to prevent this.
- AWK array/scalar collision: 'tmp' was used as an array (split()) in
  BEGIN and as a scalar later; rename the array to 'split_parts'.
- Replace $$-based temp file names with mktemp for safer uniqueness.

Co-authored-by: Ayush <Ayush-15@live.com>
Copy link
Copy Markdown

@fredbirdagain fredbirdagain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean shell scripting improvements. IFS handling is now proper, awk compatibility fixes for POSIX compliance, and secure temp file generation with mktemp. Vercel passes. LGTM. 🐦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants