(sigil env)
(sigil env) - Environment Variable Utilities
Provides utilities for working with environment variables, including loading from .env files.
Exports
load-env-file!procedureLoad environment variables from a .env file.
Parses the file and sets environment variables for each line. Supports standard .env format:
- KEY=value (one per line)
- Lines starting with # are comments
- Values can be quoted with " or '
- Empty lines are ignored
Does nothing if the file doesn't exist.
parse-env-lineprocedureParse a single .env line and set the environment variable
strip-quotesprocedureRemove surrounding quotes from a string
getenv-defaultprocedureGet an environment variable with a default value.
Returns the value of the environment variable, or the default if the variable is not set.
getenv-requiredprocedureGet a required environment variable.
Returns the value of the environment variable, or raises an error if the variable is not set.