Skip to content

Handle parentheses in variables in commands#1346

Merged
djmb merged 1 commit intobasecamp:mainfrom
i7an:handle-parentheses
Apr 22, 2025
Merged

Handle parentheses in variables in commands#1346
djmb merged 1 commit intobasecamp:mainfrom
i7an:handle-parentheses

Conversation

@i7an
Copy link
Contributor

@i7an i7an commented Jan 8, 2025

Variables with parentheses are not handled correctly in commands:

SECRETS=\\{\\\"PASSWORD\\\":\\\"pa\\(\\(word\\\"\\}
PASSWORD=$(kamal secrets extract PASSWORD ${SECRETS})

Expected kamal secrets print output:

SECRETS=\{\"PASSWORD\":\"pa\(\(word\"\}
PASSWORD=pa((word

Actual kamal secrets print output:

SECRETS=\{\"PASSWORD\":\"pa\(\(word\"\}
PASSWORD=$(kamal secrets extract PASSWORD \{\"PASSWORD\":\"pa\(\(word\"\})

This PR depends on another one bkeepers/dotenv#526. The dependency was approved bkeepers/dotenv#526 (comment) but not merged so as not to break kamal.

The plan

  • Merge and release this patch. It is backward compatible and will work with patched and with unpatched dotenv
  • Merge and release the dotnenv patch

@djmb
Copy link
Collaborator

djmb commented Apr 22, 2025

This is great, thank you coordinating this @i7an!

Once the dotenv fix is out we can update the gemspec to ensure we have that version and then add a test to confirm the fix works.

@djmb djmb merged commit 8789a1b into basecamp:main Apr 22, 2025
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