Consider the following example where make-env task produces a .env file and my-task task depends on make-env and loads .env. I would expect to see MY_VAR = MY_VALUE after running the task my-task command, but it is MY_VAR = instead. It seems like it loads the dotenv file first (but does not fail because the file does not exist yet?) and then executes all dependencies.
---
version: 3
tasks:
make-env:
cmds:
- echo "MY_VAR=MY_VALUE" >> ./.env
my-task:
deps:
- make-env
dotenv:
- ./.env
cmds:
- echo "MY_VAR = $MY_VAR"
- Task version: v3.31.0 (h1:o6iyj9gPJXxvxPi/u/l8e025PmM2BqKgtLNPS2i7hV4=)
- Operating system: macOS 13.6 (22G120)
- Experiments enabled: no
Consider the following example where
make-envtask produces a.envfile andmy-tasktask depends onmake-envand loads.env. I would expect to seeMY_VAR = MY_VALUEafter running the task my-task command, but it isMY_VAR =instead. It seems like it loads the dotenv file first (but does not fail because the file does not exist yet?) and then executes all dependencies.