get_config: Search for config files and return variable / value pairs as...

Description Usage Arguments Details Value Examples

View source: R/get_config.R

Description

DecoupleR currently supports only .env files. 'get_config' will search if the speficied directory and its parent a '.env' file. If no file is found, a empty list is returned.

Usage

1
get_config(path = NULL)

Arguments

path

a path from where a config if searched for. Parent directories will be evaluated if no config file is found is the specified directory. If NULL, the current directory will be taken as default.

Details

## Env file:

Simply create a .env text file on your repository's root directory in the form:

1
2
3
4
5
6
DEBUG=True
TEMPLATE_DEBUG=True
SECRET_KEY=ARANDOMSECRETKEY
DATABASE_URL=mysql://myuser:mypassword@myhost/mydatabase
PERCENTILE=90
#COMMENTED=42

Value

a list with variables / values from config file. If no config file has been found, an empyt list is returned.

Examples

1
2
config <- get_config()
config

durandmorgan/DecoupleR documentation built on Jan. 1, 2021, 12:09 a.m.