Skip to contents

This function adds metadata to a YAML configuration file by modifying the provided key-value pair in the metadata section of the file.

Usage

add_metadata(config_path, key, value)

Arguments

config_path

The file path to the YAML configuration file

key

The key for the new metadata entry

value

The value for the new metadata entry

Value

The updated configuration after adding the new metadata

Examples

# Read the YAML file
test_config <- system.file("config", "default_config.yml", package = "connector")
file.copy(test_config, "test_config.yaml")
#> [1] TRUE

# Add metadata
config <- add_metadata("test_config.yaml", "new_metadata", "new_value")

unlink("test_config.yaml")