-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
Environment variable nested items function #1087
Comments
Ah I see - it would need to evaluate the expression in As a work around, you could use bash string interpolation to work around it - though that can get tricky with quote escaping as you'll need to wrap the expression in double quotes so bash knows to interpolate it.
|
I've added a |
Fixed in 4.19.1 - see |
Forgot link: https://mikefarah.gitbook.io/yq/operators/eval |
Hi Mike, I just wanted to say a massive thank you for adding this so quickly. I'll trial it in my development environment this coming week and let you know how I get on. |
Please describe your feature request.
I wish I could use yq to split a variable string into an array to use within my code.
As 'variable=a yq evel '.[env(variable)] = "something"' only works at one level nesting, I would like a new function to work with multiple nested paths e.g. 'nested_variable=a.b.c yq evel '.[arrenv(nested_variable)] = "something"' (I have used 'arr' prefix as an example but it could be anything.)
The main reason for this is to have a reusable task for my continuous integration pipeline where the path to the 'tag' in the example below will be in different nested positions in the .yaml file on different projects.
Describe the solution you'd like
If we have values.yaml like:
And we run a command:
it could output
I love using yq and this would make it even better!
cheers Aaron
The text was updated successfully, but these errors were encountered: