Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use variable in backticks? #731

Closed
Boscop opened this issue Nov 29, 2020 · 1 comment
Closed

How to use variable in backticks? #731

Boscop opened this issue Nov 29, 2020 · 1 comment

Comments

@Boscop
Copy link

Boscop commented Nov 29, 2020

How can I do this?

foo := `echo {{bar}} | tr '[:upper:]' '[:lower:]'`

Or this:

version := `sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/v\1/p' {{foo}}/Cargo.toml | head -1`

When I do this, they are not substituted.

@casey
Copy link
Owner

casey commented Nov 29, 2020

This isn't currently supported, but there's an open issue for it: #11

The design I currently favor, to avoid breaking backwards compatibility, is to require strings and backticks inside of which interpolation is desired to be proceeded by a f, so:

foo := f`echo {{bar}} | tr '[:upper:]' '[:lower:]'`

@casey casey closed this as completed Nov 29, 2020
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

No branches or pull requests

2 participants