# Interactive example
if (interactive()) {
tmpdir <- file.path(tempdir(), "brand_files")
# Initialize config and local brand file
brand_init(install_path = tmpdir)
# Update local brand file if needed
get_brand_private_github(
config_file = file.path(tmpdir, "rbranding_config.yml")
)
# Cleanup
unlink(tmpdir, recursive = TRUE)
}
if (FALSE) {
# Example not run because it requires a GitHub
# personal access token with repo access
tmpdir <- file.path(tempdir(), "brand_files")
brand_init(install_path = tmpdir)
get_brand_private_github(
config_file = file.path(tmpdir, "rbranding_config.yml"),
auth_token = "your_github_token_here",
run_interactive = FALSE,
backup = TRUE,
backup_folder = tmpdir
)
# Cleanup
unlink(tmpdir, recursive = TRUE)
}
Run the code above in your browser using DataLab