Skip to contents

Identify the file path to the target script of the pipeline currently running.

Usage

tar_path_script()

Value

Character, file path to the target script of the pipeline currently running. If called outside of the pipeline currently running, tar_path_script() returns tar_config_get("script").

Examples

tar_path_script()
#> [1] "_targets.R"
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) { # for CRAN
tar_dir({ # tar_dir() runs code from a temp dir for CRAN.
script <- tempfile()
tar_script(tar_target(x, tar_path_script()), script = script, ask = FALSE)
tar_make(script = script)
tar_read(x)
})
}