if (interactive()) {
my_tmpl <- function(name, path, ...) {
# Define a template that write to the
# module file
write(name, path)
}
golem::add_module(name = "custom", module_template = my_tmpl)
my_other_tmpl <- function(name, path, ...) {
# Copy and paste a file from somewhere
file.copy(..., path)
}
golem::add_module(name = "custom", module_template = my_other_tmpl)
}
Run the code above in your browser using DataLab