Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set usage arguments and flags as environment variables for toml tasks #4159

Merged
merged 3 commits into from
Feb 8, 2025

Conversation

gturi
Copy link
Contributor

@gturi gturi commented Jan 19, 2025

Fixes #4070

@jdx I have tested it locally and everything seems to work fine, but before merging the PR I would like to have your opinion if everything seems ok. After that, I would like to add some e2e tests, but I do not know whether it is better to add them to e2e/tasks/test_task_run_toml, e2e/tasks/test_task_vars or to create a new test file just for this feature. Where do you think it is best to add them?

@gturi gturi marked this pull request as ready for review February 1, 2025 15:49
@jdx
Copy link
Owner

jdx commented Feb 8, 2025

I think this is a solid change!

One thing I believe it doesn't handle, and I don't know how important it is—or how tough it would be to add, would be using templates with env vars:

[tasks.usage-env]
usage = '''
flag "-m --myflag <myflag>" default="foo"
'''
run = 'echo myflag={{env.usage_myflag}}'

@jdx jdx merged commit 2613829 into jdx:main Feb 8, 2025
18 checks passed
@gturi
Copy link
Contributor Author

gturi commented Feb 8, 2025

Yes, unfortunately, it does not handle templates with environment variables right now... However, it could certainly be an interesting addition for the future

jdx pushed a commit that referenced this pull request Feb 8, 2025
### 🚀 Features

- **(registry)** add jd by [@risu729](https://github.com/risu729) in
[#4318](#4318)
- **(registry)** add jc by [@risu729](https://github.com/risu729) in
[#4317](#4317)
- **(registry)** Add qsv cli by [@vjda](https://github.com/vjda) in
[#4334](#4334)
- add support for idiomatic go.mod file by
[@roele](https://github.com/roele) in
[#4312](#4312)
- add -g short version for unuse cmd by
[@kimle](https://github.com/kimle) in
[#4330](#4330)
- add git remote task provider by [@acesyde](https://github.com/acesyde)
in [#4233](#4233)
- set usage arguments and flags as environment variables for toml tasks
by [@gturi](https://github.com/gturi) in
[#4159](#4159)

### 🐛 Bug Fixes

- **(aqua)** trim prefix before comparing versions by
[@risu729](https://github.com/risu729) in
[#4340](#4340)
- wrong config file type for rust-toolchain.toml files by
[@roele](https://github.com/roele) in
[#4321](#4321)

### 🚜 Refactor

- **(registry)** use aqua for yq by [@scop](https://github.com/scop) in
[#4326](#4326)

### 📚 Documentation

- **(schema)** fix description of task.dir default by
[@risu729](https://github.com/risu729) in
[#4324](#4324)
- Add PowerShell example by [@jahanson](https://github.com/jahanson) in
[#3857](#3857)
- Include "A Mise guide for Swift developers" by
[@pepicrft](https://github.com/pepicrft) in
[#4329](#4329)
- Update documentation for core tools by
[@hverlin](https://github.com/hverlin) in
[#4341](#4341)
- Update vitepress to fix search by
[@hverlin](https://github.com/hverlin) in
[#4342](#4342)

### Chore

- **(bun.lock)** migrate bun lockfiles to text-based by
[@risu729](https://github.com/risu729) in
[#4319](#4319)

### New Contributors

- @vjda made their first contribution in
[#4334](#4334)
- @kimle made their first contribution in
[#4330](#4330)
- @pepicrft made their first contribution in
[#4329](#4329)
- @jahanson made their first contribution in
[#3857](#3857)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set usage arguments and flag as environment variables before running the command
2 participants