Skip to contents

Write a spec_ir object to disk as YAML or JSON

Usage

write_spec_ir(spec, path, format = NULL, validate = TRUE)

Arguments

spec

A spec_ir object.

path

File path to write.

format

Optional format ("yaml" or "json"). Inferred from path extension when NULL.

validate

Logical; if TRUE (default), validates spec prior to writing.

Value

Invisibly returns path.

Examples

spec <- new_spec_ir()
tmp <- tempfile(fileext = ".yaml")
write_spec_ir(spec, tmp)
unlink(tmp)