use_template: Use template

Description Usage Arguments Examples

Description

Motivated by usethis::use_template, but needed to be liberated from always using usethis::proj_path as hard-coded directory.

Usage

1
2
3
4
5
6
7
8
use_template(
  template,
  save_as = template,
  data = list(),
  ignore = FALSE,
  open = FALSE,
  package = .env_package_name()
)

Arguments

template

[character] File name of template (within ./inst/templates/ or templates/ for the built package)

save_as

[character] File name of the resulting file

data

[list] Data to pass on to template (names need to match placeholder)

ignore

[logical]

  • TRUE: add to .Rbuildignore

  • FALSE: do nothing

open

[logical]

  • TRUE: open the file in the IDE

  • FALSE: do nothing

package

[character] Package name

Examples

1
use_template("Dockerfile", save_as = tempfile())

rappster/renv2docker documentation built on Dec. 22, 2021, 12:57 p.m.