Skip to content

Fix shell variable interpolation in Python heredoc#6

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

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

Conversation

Copy link

Copilot AI commented Feb 4, 2026

The configure-claude-mcp.sh script was using unquoted heredoc with shell variables inside Python code, causing variables to be passed literally rather than interpolated correctly.

Changes

  • Use quoted heredoc delimiter (<< 'PYEOF') to prevent premature shell expansion
  • Pass shell variables as command-line arguments to Python script
  • Read file paths from sys.argv instead of attempting variable interpolation

Before:

python3 << PYEOF
with open("$CLAUDE_CONFIG", 'r') as f:  # $CLAUDE_CONFIG passed literally
    base = json.load(f)
PYEOF

After:

python3 - "$CLAUDE_CONFIG" "$TEMP_CONFIG" << 'PYEOF'
base_config_file = sys.argv[1]  # Reads actual path value
overlay_config_file = sys.argv[2]
with open(base_config_file, 'r') as f:
    base = json.load(f)
PYEOF

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix architecture updates related to rune-admin based on feedback 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-again 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