Check if the parts of a template are in place, based on the template's spec.
Usage
check_template(template, name = "", dir = ".", spec = NULL)
Arguments
- template
Name of the template (e.g., "function"
).
- name
Name of the template instance (e.g., "test_function"
).
- dir
Path to the base directory of the template.
- spec
The template's spec; specify if template spec files do not exist.
Value
A list with results of the check:
dir | Path of the checked directory. |
files | Path(s) of the checked files. |
spec | A list with the template's spec. |
status | A named logical vector indicating whether each components exist. |
incomplete | A character vector with any existing files that still have template text. |
exists | all(status) |
message | A character vector including messages associated with failures. |
Examples
if (FALSE) { # \dontrun{
# precheck before a new template is made
check_template("template_new", list(name = "new", context = "new", files = list("new.R")))
# check the new template after creation
check_template("new")
} # }