-
-
Notifications
You must be signed in to change notification settings - Fork 775
Open
Labels
area: docsChanges related to documentation.Changes related to documentation.
Description
Summary
The documentation does not clarify which dotenv file takes precedence when multiple files are specified in the dotenv array.
Current Documentation
The usage guide shows this example:
dotenv: ['.env', '{{.ENV}}/.env', '{{.HOME}}/.env']But it doesn't specify whether the first or last file in the array takes precedence when the same variable appears in multiple files.
Observed Behavior (Task v3.44.1)
Through empirical testing, I found that the first file wins (first listed file takes precedence):
# Test setup
dotenv:
- '.env.local' # Contains: API_URL=http://local-override:9999
- '.env' # Contains: API_URL=http://localhost:5029
# Result: API_URL=http://local-override:9999 (first file wins)When reversed:
dotenv:
- '.env' # Contains: API_URL=http://localhost:5029
- '.env.local' # Contains: API_URL=http://local-override:9999
# Result: API_URL=http://localhost:5029 (first file still wins)Request
Please update the documentation to explicitly state the precedence order for multiple dotenv files. This is important for users who want to implement override patterns like:
dotenv:
- '.env.{{.ENV}}.local' # Local overrides (if first wins, put highest priority first)
- '.env.{{.ENV}}' # Environment config
- '.env' # Base defaultsEnvironment
- Task version: 3.44.1
- OS: Windows (MINGW64)
Metadata
Metadata
Assignees
Labels
area: docsChanges related to documentation.Changes related to documentation.