This function initializes the configuration setup by creating the configuration file, encrypted configuration file, and configuration template file.
It also sets the R_CONFIG_FILE
environment variable to the path of the configuration file.
Arguments
- path
Path to the configuration directory. Defaults to
inst/config
.- cfg
A list of configuration settings. Defaults to an empty list.
- cfg_file
Path to the configuration file. Defaults to
config.yml
.- cfg_file_encrypted
Path to the encrypted configuration file. Defaults to
config.encrypted.yml
.- cfg_file_template
Path to the configuration template file. Defaults to
config.template.yml
.- encryption_key_name
The name of the environment variable that contains the encryption key. Defaults to
NOCLOCKS_ENCRYPTION_KEY
.- overwrite
Overwrite the existing configuration files. Defaults to
FALSE
.- symlink
Create a symlink to the configuration file. Defaults to
TRUE
.- ...
Additional arguments passed to other functions.
Details
The cfg_init()
function creates the following files:
config.yml
: The configuration file containing the configuration settings.config.encrypted.yml
: The encrypted configuration file.config.template.yml
: The configuration template file..gitignore
: The gitignore file to ignore the configuration files.README.md
: The README file with instructions on how to use the configuration files.