Adds [protoc-gen-validate
tool](https://github.com/bufbuild/protoc-gen-validate). As it is a
protoc plugin, there's not a great way to test it off the bat.
```
mise use go:github.com/bufbuild/protoc-gen-validate
go: downloading github.com/bufbuild/protoc-gen-validate v1.2.1
go: downloading github.com/iancoleman/strcase v0.3.0
go: downloading google.golang.org/protobuf v1.36.3
go: downloading github.com/lyft/protoc-gen-star/v2 v2.0.4-0.20230330145011-496ad1ac90a4
go: downloading github.com/spf13/afero v1.10.0
go: downloading golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
go: downloading golang.org/x/mod v0.17.0
mise go:github.com/bufbuild/protoc-gen-validate@1.2.1 ✓ installed
mise ~/test/.mise.toml tools: go:github.com/bufbuild/protoc-gen-validate@1.2.1
```
```
mise use aqua:bufbuild/protoc-gen-validate
mise aqua:bufbuild/protoc-gen-validate@1.2.1 ✓ installed
mise ~/test/.mise.toml tools: aqua:bufbuild/protoc-gen-validate@1.2.1
```
## Background and Purpose
When nushell has shims in the PATH, `activate nu` outputs an incorrect
script.
The problem is at the beginning of the script generated by `activate nu`
```
set,Path,C:\Program Files\Microsoft VS Code\bin;C:\Program Files\PowerShell\7
```
This gives the following error in nushell 0.102.
```
Error: nu:🐚:external_command
× External command failed
╭─[entry #55:1:1]
1 │ set,Path,C:\Program Files\Microsoft VS Code\bin;C:\Program Files\PowerShell\7
· ─────────┬─────────
· ╰── Command `set,Path,C:\Program` not found
╰────
help: `set,Path,C:\Program` is neither a Nushell built-in or a known external command
```
This is not a Nu script, but a CSV protocol.
The nushell functions defined in `activate` (`def “parse vars”`) parse
CSV only for `deactivate`, `shell` and `sh` command output.
The CSV protocol is not available in `activate` itself, so it must
output valid Nu scripts.
## Changes
- `Shell::set_env` should change the output if it is running in the
context of `activate`. I introduced `enum ActivatePrelude` to avoid
making it mutable.
## Impact
- The output of other shells is kept the same.
Co-authored-by: jdx <216188+jdx@users.noreply.github.com>
# Description
- chore(registry): declare copier with pipx/uvx backend and asdf plugin
## Note
- if there is a way to test this kind of PR locally, I'd be happy to do
it (did not find something related to the registry PRs in the doc)
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [ctor](https://redirect.github.com/mmastrac/rust-ctor) |
dev-dependencies | minor | `0.2` -> `0.4` |
---
### Configuration
📅 **Schedule**: Branch creation - "before 4am on Friday" in timezone
America/Chicago, Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/jdx/mise).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNzYuMiIsInVwZGF0ZWRJblZlciI6IjM5LjE3Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR enables the use of `arg`, `option`, and `flag` in task templates
within `if` conditions or similar syntaxes.
### Current Behavior
Currently, placeholders are replaced only after the Tera template is
fully rendered. So, expressions like the following:
```toml
[tasks.test]
run = "echo {% if flag(name='test') == 'true' %}test is true{% endif %}"
```
would incorrectly render `mise test --test` as just `echo ` because
`'MISE_TASK_ARG:test:MISE_TASK_ARG' != 'true'`.
### Changes
Since we need to parse the usage spec before rendering the full Tera
template, this PR adds the second rendering after the usage spec is
processed. This ensures that expressions with nest like this are
evaluated correctly.
```toml
[tasks.test]
run = "echo {% if flag(name=env.FLAG_NAME) == 'true' %}TRUE{% endif %}"
```
Re-rendering the template might introduce some performance overhead, but
I believe it's the simplest solution for this.
Of course, templates with more nests cannot be parsed correctly, but it
is impossible if we are using usage to parse args in the template.
~~I still need to fix this PR to avoid code duplication and handle
escapes, but I’d like to hear your thoughts on this approach.~~
---
Apologies for creating a PR directly. I was debugging locally and wanted
to share the idea.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Fixes https://github.com/jdx/mise/discussions/4607.
I used `SETTINGS.default_inline_shell()` because the parsed scripts are
executed with it, but `env::SHELL` should also be fine for this case.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>