PtcRunner.Dotenv (PtcRunner v0.10.1)

Copy Markdown View Source

Loads environment variables from .env files.

Walks up from a starting directory to find the nearest .env file and sets variables that aren't already present in the environment.

Examples

# Load from nearest .env, only once per VM
PtcRunner.Dotenv.load()

Summary

Functions

Load environment variables from the nearest .env file.

Functions

load()

@spec load() :: :ok

Load environment variables from the nearest .env file.

Walks up from the current working directory looking for a .env file. Only sets variables that aren't already set (existing env vars take precedence). Safe to call multiple times — only loads once per VM.