Env Module
Reads the environment variables of the process, loads unset variables from a .env file and returns a text with system information.
Functions and values
| Function or value |
Description
|
|
Returns current process environment variables as a dictionary (portable) - Uses the current process environment only (works on all platforms) - Case-insensitive keys to avoid casing pitfalls across OSes - Does not filter out PATH or any other variable
|
|
Get an environment variable from the current process. Returns None if the variable does not exist.
|
Full Usage:
getSystemInfo ()
Parameters:
unit
Returns: string
|
|
Full Usage:
loadDotEnv ()
Parameters:
unit
Returns: bool
|
Load environment variables from a .env file. Searches upward from the current directory for a .env file. Only sets variables that are not already set in the environment, preserving the override chain: shell/CI/Docker > .env > code defaults. Returns true if a .env file was found and processed.
|
Full Usage:
parseLine line
Parameters:
string
Returns: (string * string) option
|
Parses one line of a .env file into its key and value, both trimmed and the value unquoted. The value runs from the first equals sign to the end of the line, so it can hold an equals sign itself. A blank line, a comment, a line without an equals sign and a line with an empty key give None.
|
Full Usage:
unquote value
Parameters:
string
Returns: string
|
Removes one pair of matching surrounding quotes, double or single, from a value. A value without them, or with a quote at one end only, is returned as it is.
|
GenPRES