Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
eklunko opened this issue Feb 5, 2025 · 1 comment
Closed

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

eklunko opened this issue Feb 5, 2025 · 1 comment

Comments

@eklunko
Copy link

eklunko commented Feb 5, 2025

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"
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Feb 5, 2025
@vmaerten vmaerten removed the state: needs triage Waiting to be triaged by a maintainer. label Feb 8, 2025
@vmaerten
Copy link
Member

vmaerten commented Feb 8, 2025

Hello !
There is a typo in the documentation: there is a dot at the end of {{.ENV}}/.env. that should not be there.

Using this Taskfile works as expected

# Taskfile.yml
version: '3'

env:
  ENV: testing

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

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

@vmaerten vmaerten closed this as completed Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants