Create and add if does not exist #338
Unanswered
electriquo
asked this question in
Q&A
Replies: 1 comment 2 replies
-
This kind of optional update doesn't really exist yet, but you should be able to combine 2 dasel commands together to get the expected outcome. To check the presence of some item you could use this.
You can then wrap this with a simple check and perform some action:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
how can i make dasel to create an array and add an object to it if the object is does not exist.
for instance, giving an empty json/yaml, how to make dasel create a key named
names
that is an array with the object{"name": "Tom", "level": "Master"}
to achieveyet, if the
{"name": "Tom", "level": "Master"}
object already exist, then do nothing.Beta Was this translation helpful? Give feedback.
All reactions