Draft
Conversation
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 Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…_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>
fredbirdagain
approved these changes
Mar 23, 2026
fredbirdagain
left a comment
There was a problem hiding this comment.
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. 🐦
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
install.shto correctly handleIFSfor space-based word-splitting in category detection and installation.The installer's global
IFS=$'\n\t'setting prevented correct word-splitting on spaces inis_category_supportedandget_available_categories, causing non-interactive installations to fail with "error: no supported categories". This PR saves and restoresIFSaround affected loops andprintfcalls to ensure proper array iteration and string joining.