Cancel a target while its command is running if a condition is met.
Details
Must be invoked by the target itself. tar_cancel()
cannot interrupt a target from another process.
Examples
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) { # for CRAN
tar_dir({ # tar_dir() runs code from a temp dir for CRAN.
tar_script(tar_target(x, tar_cancel(1 > 0)))
tar_make() # Should cancel target x.
})
}