how to load env variables from .env file in task

the source shell command is not available. I tried
"tasks": {
"my-task": "export .env && my-command",
}
"tasks": {
"my-task": "export .env && my-command",
}
is that correct? it's not working now. Where can I see what commands are available in tasks?
3 Replies
marvinh.
marvinh.•10mo ago
The commands inside tasks are run in your shell, with the addition that some of our own ones are added there when running a task. So which commands are available depends entirely on your machine and what you have installed over the duration of using it.
Leokuma
Leokuma•10mo ago
export $(cat .env | xargs) && my-command
export $(cat .env | xargs) && my-command
Cross-OS commands: https://docs.deno.com/runtime/manual/tools/task_runner#built-in-commands
deno task | Deno Docs
deno task provides a cross platform way to define and execute custom commands
shultz🇮🇱
shultz🇮🇱OP•10mo ago
Thanks!:hooray_deno:

Did you find this page helpful?