Selector failing to select a child element in a TOML file #97
-
Thanks for this amazing tool! I'm trying to search and replace in a TOML file, but I'm unable to select child elements from within the file - config.toml.txt Selecting the property "check_interval" works fine when I run But if I try to select disable_cache from [runners.docker], I run and receive an error of I've also tried "runners:docker:disable_cache" and "runners.runners.docker.disable_cache", but those aren't working either. Thanks again, your work is greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @MrDionysus, I'm glad you're finding dasel useful. I've taken a look and the issue is in your TOML file. I see you have You can either use this selector: Or change I've also made a note to improve these error messages in the future. |
Beta Was this translation helpful? Give feedback.
-
Fantastic! That helped a lot. The only other problem I'm facing is using a put to add a list of strings instead of a single string. Is that even possible? For example, see below where there's a list of string values for MachineOptions: [runners.machine] |
Beta Was this translation helpful? Give feedback.
Hey @MrDionysus,
I'm glad you're finding dasel useful.
I've taken a look and the issue is in your TOML file.
I see you have
[[runners]]
- notice the double square brackets. This causes runners to be an array containing a map with your expected values.You can either use this selector:
.runners.[0].docker.disable_cache
- example on playgroundOr change
[[runners]]
to[runners]
and use this selector:.runners.docker.disable_cache
- example on playgroundI've also made a note to improve these error messages in the future.