offlineRule: Rule for requesting manual user action

View source: R/offlineRule.R

offlineRuleR Documentation

Rule for requesting manual user action

Description

Instead of building the target, this rule simply issues the given error message. This rule is useful for cases, where the target target depends on depends, but has to be updated by some manual process. So if target is older than any of its dependencies, make will throw an error until the user manually updates the target.

Usage

offlineRule(target, message, depends = NULL, task = "all")

Arguments

target

A character vector of target file names of the manual (offline) build command

message

An error message to be issued if targets are older than dependencies from depends

depends

A character vector of file names the targets depend on

task

A character vector of parent task names. The mechanism of tasks allows to group rules. Anything different from 'all' will cause creation of a new task depending on the given rule. Executing make taskname will then force building of this rule.

Value

Instance of S3 class rmake.rule

Author(s)

Michal Burda

See Also

rule(), makefile()

Examples

r <- offlineRule(target='offlinedata.csv',
                 message='Please re-generate manually offlinedata.csv',
                 depends=c('source1.csv', 'source2.csv'))

# generate the content of a makefile (as character vector)
makefile(list(r))

# generate to file
tmp <- tempdir()
makefile(list(r), file.path(tmp, "Makefile"))

beerda/rmake documentation built on July 2, 2022, 6:24 p.m.