task icon indicating copy to clipboard operation
task copied to clipboard

dotenv file path not using var from command line

Open mkyc opened this issue 2 years ago • 0 comments

  • Task version: v3.10.0 (h1:vOAyD9Etsz9ibedBGf1Mu0DpD6V0T1u3VG6Nwh89lDY=)
  • Operating System: macOS Monterey 12.1

Taskfile.yml:

version: '3'

vars:
  ACCOUNT: test

dotenv: [ ".env.{{.ACCOUNT}}" ]

tasks:
  print:
    cmds:
      - echo $TEST_VAR

.env.test:

TEST_VAR=lilili

.env.other:

TEST_VAR=lalala
~ task print                                
task: [print] echo $TEST_VAR
lilili
~task print ACCOUNT=other
task: [print] echo $TEST_VAR
lilili

should be lalala.

I guess dotenv is evaluated before command line args.

mkyc avatar Jan 18 '22 15:01 mkyc