Merge two YAML files using the yq
tool.
Usage
yq_merge_cmd(
f1,
f2,
stdout = TRUE,
check_yq = TRUE,
check_exit = TRUE,
yq_binary = getOption("scdrake_yq_binary")
)
Arguments
- f1, f2
A character scalar: path to YAML file.
f2
is the file whose parameters will overwrite those inf1
.- stdout
A character or logical scalar, or
NULL
: passed tobase::system2()
.For character scalar: path to file into which the resulting merged YAML file will be written. If empty string (
""
), the result will be written to R console.For logical scalar
TRUE
: return the stdout as a character scalar.For logical scalar
FALSE
, orNULL
: discard the stdout.
- check_yq
A logical scalar: if
TRUE
, checkyq
tool presence withcheck_yq()
prior to merging.- check_exit
A logical scalar: if
TRUE
andstdout
isFALSE
, check exit code of shell command used for merging.- yq_binary
A character scalar: path to
yq
tool's binary.
Value
An output from base::system2()
- depends on the stdout
argument.