rliebz / tusk

The modern task runner
https://rliebz.github.io/tusk/
MIT License
237 stars 21 forks source link

Add support for dotenv files #104

Closed rliebz closed 3 months ago

rliebz commented 7 months ago

While I'm not sure there is a formal dotenv specification, I've used a library that's meant to be compatible with other language libraries, which should make things pretty familiar and compatible.

I've also attempted to model the semantics used by Docker Compose for file configuration, although 100% compatibility is probably not a guarantee this project will ever make.

Closes #98 Supercedes #99

rliebz commented 7 months ago

@elyoni @smyrman—Here's my first pass at environment file support. Let me know if you have any thoughts here, or if there's anything this doesn't solve for that you think belongs in the first iteration.

One feature that was mentioned that I would probably punt on for now is specifying environment files anywhere other than the root of the configuration file. One of the weird things about sub-tasks and environment variables is that once an env var is set, there aren't super direct/obvious semantics for if that scope ends, or how that would interact with sub-tasks. Which is why run.set-environment very explicitly includes the word "set" and calls out that the change will persist until the program exits. That doesn't mean task-level env files can't ever happen, though, and I don't think this PR does anything that would make it harder down the line if a good design becomes obvious at any point.

smyrman commented 3 months ago

Sorry for not responding to your comment on Apr. 9; I might just forgot to answer as we haven't tried this out yet. I'll be sure to give you any feedback when we get to try this out. The feature as you describe it in the new docs sounds reasonable.

I might add that we are very happy with tusk in our organization.

rliebz commented 3 months ago

All good! Thanks for taking a look, I'll probably push a release out shortly.