You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dotenv file path not using var from command line #658
Hope this will be fixed soon, but right now I found 2 possible workarounds.
The first one is that you can define the dotenv: part on task level, and this works as expected. The drawback is however that you need to duplicate it throughout the taskfile in each task that needs then environment variables. For example:
The other method is the use the strange fact that using variables seems to work ok with in the env: and sh: part. You can read and parse the .env file manually here. Which is very ugly/verbose, but that you only need to do it once in the taskfile. For example:
(This will also print a warning: cat: .env.: No such file or directory, but it still works. Pretty sure the command gets evaluated twice, once on general setup, and once again for the setup of the task.)
Activity
matthijsdewit111 commentedon Jul 2, 2024
Hope this will be fixed soon, but right now I found 2 possible workarounds.
The first one is that you can define the
dotenv:part on task level, and this works as expected. The drawback is however that you need to duplicate it throughout the taskfile in each task that needs then environment variables. For example:The other method is the use the strange fact that using variables seems to work ok with in the
env:andsh:part. You can read and parse the .env file manually here. Which is very ugly/verbose, but that you only need to do it once in the taskfile. For example:(This will also print a warning:
cat: .env.: No such file or directory, but it still works. Pretty sure the command gets evaluated twice, once on general setup, and once again for the setup of the task.)trulede commentedon Dec 7, 2025
Fixed by #2288