Pudu programming language
Menu
Package

@chrismichaelps / pudu-lang-environment

Environment files for Pudu: load .env variables safely with layered files, discovery, expansion, typed reads, and secrets kept out of every message

0.1.0Apache-2.01

InstallClose

Discovery.md

Markdown25 lines1012 B

GitHub ↗

Discovery


type: domain tags: [domain]


Which files a load reads, in one of three modes:

ModeOptionFiles
Givenfiles (default [".env"])each path, relative to directory
Probingprobe: Some(levels)the first .env found in directory or up to levels parents
Cascadecascade: truewhichever of .env, .env.local, .env.<name>, .env.<name>.local exist, in that order

The cascade's name is environmentName, else the first of PUDU_ENV and PROFILE that is set and not blank. A name holding .., a path separator, or a character a file name cannot hold is refused outright, so the cascade cannot reach outside its directory. Cascade and probing combine: the cascade's files are looked for upward. Sources given as text or bytes bypass discovery. See [[src/PuduLangEnvironment/Discovery]] and [[src/PuduLangEnvironment/Domain/Cascade]].

Referenced by

[[architecture/LANGUAGE]] · [[domain/_MOC]] · [[subsystems/Loading]]