Skip to content

Fix shell variable interpolation in Python heredoc#7

Closed
Copilot wants to merge 1 commit intofeature/architecture-fixfrom
copilot/sub-pr-4-another-one
Closed

Fix shell variable interpolation in Python heredoc#7
Copilot wants to merge 1 commit intofeature/architecture-fixfrom
copilot/sub-pr-4-another-one

Conversation

Copy link

Copilot AI commented Feb 4, 2026

The Python heredoc in configure-claude-mcp.sh was attempting to use shell variable interpolation ($CLAUDE_CONFIG, $TEMP_CONFIG), which doesn't work as the strings are passed literally to Python.

Changes

  • Pass file paths as command-line arguments to Python: python3 - "$CLAUDE_CONFIG" "$TEMP_CONFIG"
  • Use single-quoted heredoc marker << 'PYEOF' to prevent shell expansion
  • Modified Python script to read paths from sys.argv[1] and sys.argv[2]
  • Improved variable names (base_config_file, overlay_config_file) and error messages for clarity
# Before: Shell variables interpolated incorrectly
python3 << PYEOF
with open("$CLAUDE_CONFIG", 'r') as f:  # Literal string "$CLAUDE_CONFIG"
    ...

# After: Arguments passed correctly
python3 - "$CLAUDE_CONFIG" "$TEMP_CONFIG" << 'PYEOF'
base_config_file = sys.argv[1]
with open(base_config_file, 'r') as f:
    ...

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Address feedback on architecture update for rune-admin integration Fix shell variable interpolation in Python heredoc Feb 4, 2026
Copilot AI requested a review from sunchuljung February 4, 2026 06:13
@sunchuljung sunchuljung deleted the branch feature/architecture-fix February 15, 2026 14:42
@sunchuljung sunchuljung deleted the copilot/sub-pr-4-another-one branch February 16, 2026 05:30
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.

2 participants