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

Description Usage Arguments Value See Also Examples

View source: R/convert.R

Description

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

Usage

1
2
3
4
5
6
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

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

Example output



configr documentation built on July 17, 2020, 5:07 p.m.