Skip to contents

This function creates or updates the `_variables.yml` file in a Quarto project directory using froggeR settings, if they exist in the config path.

Usage

write_variables(path = here::here(), .initialize_proj = FALSE)

Arguments

path

Character string. Path to the project directory.

.initialize_proj

Logical. TRUE only if starting a froggeR::quarto_project().

Value

Invisibly returns `NULL` after creating or updating the `_variables.yml` file.

Details

The function will attempt to use the current froggeR settings from the config path. If no global configurations exist, a template `_variables.yml` will be created.

Examples

# Create a temporary directory for testing
tmp_dir <- tempdir()

# Write the _variables.yml file
write_ignore(path = tmp_dir)
#>  Created .gitignore
#>  Edit /tmp/RtmpQPJ7Yz/.gitignore.

# Confirm the file was created (optional, for user confirmation)
file.exists(file.path(tmp_dir, "_variables.yml"))
#> [1] FALSE

# Clean up: Remove the created file
unlink(file.path(tmp_dir, "_variables.yml"))