load_dot_env: Load environment variables from the specified file

Description Usage Arguments Details Examples

View source: R/load_dot_env.R

Description

The file is parsed, and line is expected to have one of the following formats:

1
2
3
4
5
6
VARIABLE=value
VARIABLE2="quoted value"
VARIABLE3='another quoted variable'
# Comment line
export EXPORTED="exported variable"
export EXPORTED2=another

Usage

1
load_dot_env(fpath = ".env")

Arguments

fpath

The path to the '.env' config file

Details

Load variables defined in the given file, as environment variables.

Detailed specification:

It is suggested to keep the file in a form that is parsed the same way with dotenv and bash (or other shells).

Examples

1
2
3
4
5
6
7
8
# Load from a file
tmp <- tempfile()

cat("dotenvexamplefoo=bar\n", file = tmp)
load_dot_env(tmp)

# Clean up
unlink(tmp)

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