Skip to contents

Write dir helper function that are robust to dev vs deployed package states

Usage

write_dir_fn(
  outfile = "R/utils_dir_fns.R",
  overwrite = TRUE,
  for_golem = file.exists("R/app_ui.R"),
  ...
)

Arguments

outfile

chr path to file to write. Default R/utils_dir_fns.R

overwrite

lgl Whether to overwrite the existing file. Default TRUE

for_golem

lgl Whether to use the app_sys function if package is a golem package

...

named directory path vectors Other dir functions to write in the form of dir_function_name = c('dir1', 'nesteddir2') where dir_function_name is the name of the function under dirs and a vector of folder names. eg for a dirs function that accesses data/plots, the argument will be plots = c('data', 'plots').

Value

msg and a new file