Retrieve configuration values from a the app's config.yml
YAML
file.
Usage
get_app_config(
value,
config = Sys.getenv("APP_CONFIG_ACTIVE", Sys.getenv("R_CONFIG_ACTIVE", "default")),
use_parent = TRUE,
file = Sys.getenv("APP_CONFIG_FILE", Sys.getenv("R_CONFIG_FILE",
app_sys("config/config.yml")))
)
Arguments
- value
Name of value (
NULL
to read all values)- config
Name of configuration to read from. Defaults to the value of the
R_CONFIG_ACTIVE
environment variable ("default" if the variable does not exist).- use_parent
TRUE
to scan parent directories for configuration files if the specified config file isn't found.- file
Configuration file to read from (defaults to
"config.yml"
). If the file isn't found at the location specified then parent directories are searched for a file of the same name.
Details
The only difference in this function and config::get()
is that this function
sets the default value of the file
argument to the app's config.yml
file
and attempts to set the config
argument to the value of the APP_CONFIG_ACTIVE
.