Skip to content

example from official documentation does not work - .env files #2039

@eklunko

Description

@eklunko

Description

Trying to reproduce this example from the doc:
https://taskfile.dev/usage/#env-files

I expect to see the following output:
Using VALUE and endpoint testing.com

I see the following:
Using VALUE and endpoint

Installation method: npm install -g @go-task/cli
npm version: 10.8.2
node version: v20.17.0
os version: Ubuntu 20.04.6 LTS under WSL in Windows 10

Version

Task version: v3.41.0 (h1:giUddhe0XZLbEWIQ/MuTPipR9ek+teulIA5xf/2IHXg=)

Operating system

Ubuntu 20.04.6 LTS (WSL in Windows 10)

Experiments Enabled

No response

Example

# .env
KEYNAME=VALUE
# testing/.env
ENDPOINT=testing.com
# Taskfile.yml
version: '3'

env:
  ENV: testing

dotenv: ['.env', '{{.ENV}}/.env.', '{{.HOME}}/.env']

tasks:
  greet:
    cmds:
      - echo "Using $KEYNAME and endpoint $ENDPOINT"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions