convert.config: Covert configuration file from JSON/INI/YAML/TOML to...

View source: R/convert.R

convert.configR Documentation

Covert configuration file from JSON/INI/YAML/TOML to JSON/INI/YAML

Description

Covert configuration file from JSON/INI/YAML/TOML to JSON/INI/YAML

Usage

convert.config(
  file = Sys.getenv("R_CONFIGFILE_ACTIVE", "config.cfg"),
  out.file = Sys.getenv("R_CONFIGFILE_ACTIVE", "config.cfg"),
  convert.to = "ini",
  ...
)

Arguments

file

File name of configuration file to read from. Defaults to the value of the 'R_CONFIGFILE_ACTIVE' environment variable ('config.cfg' if the variable does not exist and JSON/INI/YAML/TOML format only)

out.file

Output path of configuration file. Defaults to the value of the 'R_CONFIGFILE_ACTIVE' environment variable ('config.cfg' if the variable does not exist)

convert.to

JSON/INI/YAML

...

Arguments for read.config and write.config

Value

Logical indicating whether convert success

See Also

fromJSON JSON file will read by this

read.ini INI file will read by this

yaml.load_file YAML file will read by this

Examples

config.json <- system.file('extdata', 'config.json', package='configr')
config <- convert.config(file=config.json, out.file = sprintf('%s/config.ini', tempdir()))

Miachol/configr documentation built on July 22, 2023, 9:55 a.m.