try_use_renv: Try to use renv

View source: R/utils-renv.R

try_use_renvR Documentation

Try to use renv

Description

We use this when sandpaper starts to see if the user has previously consented to renv. The problem is that renv::consent() throws TRUE if the user has consented and an error if it has not :(

Usage

try_use_renv(force = FALSE)

Arguments

force

if TRUE, consent is forced to be TRUE, creating the cache directory if it did not exist before. Defaults to FALSE, which gently inquires for consent.

Details

This function wraps renv::consent() in a callr function and transforms the error into FALSE. It sets the sandpaper.use_renv variable to the value of that check and then returns the full text of the output if FALSE (this is the WELCOME message that's given when someone uses renv for the first time) and the last line of output if TRUE (a message either that a directory has been created or that consent has already been provided.)

Value

a character vector


zkamvar/sandpaper documentation built on April 21, 2024, 1:17 a.m.