You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a .json file (based on the template) to define my metadata. But I like to have comments in the metadata file, to e.g. comment certain values out, explain things, etc. So I decided to implement the rule that each key starting with a _ is a commend. So I use the following now:
metadata <- system.file(
package = "zenDep",
params$metadata_file
) |>
jsonlite::read_json()
# And filter oput al fields starting with "_" as they are considered comments
metadata <- metadata[grep("^_", names(metadata), invert = TRUE)]
cli$deposit_fill_metadata(metadata)
It would be great, if this could be implemented in the cli$deposit_fill_metadata(filename) function.
If you think there is a better option then using _ (e.g. double underscore?), please let me know. I used the underscore, as it is in the template for the note at the beginning.
The text was updated successfully, but these errors were encountered:
Good point. Would you like to submit a PR with that impovement? The line you have above with suffice, although pattern should be "^\\_" instead of "^_", and the best place would be just before this line:
I am using a
.json
file (based on the template) to define my metadata. But I like to have comments in the metadata file, to e.g. comment certain values out, explain things, etc. So I decided to implement the rule that each key starting with a_
is a commend. So I use the following now:It would be great, if this could be implemented in the
cli$deposit_fill_metadata(filename)
function.If you think there is a better option then using
_
(e.g. double underscore?), please let me know. I used the underscore, as it is in the template for the note at the beginning.The text was updated successfully, but these errors were encountered: