BT.env
BT.env
Function
reads the currently valid environment variables.
Syntax
BT.env(name)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| name | String | Yes | None | Environment variable name. |
Return Value
| Type | Description |
|---|---|
| String/Empty | Returns a string if the variable exists; returns empty if it does not exist or is obscured by a BT overlay delete mark. |
Examples
BT.set_env('BT_MODE', 'dev') result = BT.env('BT_MODE') // Output: dev print result
Notes
- When reading, first check the BT runtime environment variable overlay, and then fall back to the OS environment variable.
- An error will be reported when the environment variable name is empty.