scdel: Wrapper for remake::delete that permits cache sharing

Description Usage Arguments Details Examples

View source: R/scmake.R

Description

remake::delete() claims that for files you can generally just delete the file itself with no need to call remake::delete(). This may also be the case for a shared cache; especially for non-status-indicator files (which have no build status file) however, it seems cleaner to delete the build status files at the same time that one deletes an indicator file.

Usage

1
2
3
4
5
6
scdel(
  target_names = NULL,
  remake_file = getOption("scipiper.remake_file"),
  verbose = TRUE,
  ind_ext = getOption("scipiper.ind_ext")
)

Arguments

target_names

vector of targets to delete, or NULL to delete the default target. Use the output of list_all_targets() to delete all explicitly named targets in the remake file (excluding tidy, clean, and purge)

remake_file

as in remake::delete()

verbose

as in remake::delete()

ind_ext

the indicator file extension identifying those files for which build/status information will be deleted if their targets are remake::deleted. You should git commit the deletion of any build/status files (unless you immediately rebuild them and commit any changes instead).

Details

The option to set dependencies=TRUE for remake::delete() is omitted because it sounds terrifying to me: as currently implemented in remake, dependencies are the UPSTREAM targets on which the current target_names depend - i.e., if B is built from A and you ask to delete B with dependencies=TRUE, A will also be deleted. Scary, right? So let's not.

Examples

1
2
3
4
5
6
## Not run: 
scdel('one_target', 'remake.yml')
scdel(NULL, 'remake.yml') # delete the default target
scdel(list_all_targets('remake.yml'), 'remake.yml')

## End(Not run)

aappling-usgs/scipiper documentation built on Aug. 1, 2020, 3:11 p.m.