project_hook: Project Hook

Description Usage Arguments Value Examples

View source: R/templates.R

Description

Project hooks allow to define a function run just after {golem} project creation.

Usage

1
project_hook(path, package_name, ...)

Arguments

path

Name of the folder to create the package in. This will also be used as the package name.

package_name

Package name to use. By default, golem uses basename(path). If path == '.' & package_name is not explicitly set, then basename(getwd()) will be used.

...

Arguments passed from create_golem(), unused in the default function.

Value

Used for side effects

Examples

1
2
3
4
5
6
if (interactive()) {
  my_proj <- function(...) {
    unlink("dev/", TRUE, TRUE)
  }
  create_golem("ici", project_template = my_proj)
}

golem documentation built on April 17, 2021, 9:06 a.m.