Skip to content

fix: do not default to writing to mise.$MISE_ENV.toml#4817

Merged
jdx merged 1 commit intomainfrom
use-env
Apr 10, 2025
Merged

fix: do not default to writing to mise.$MISE_ENV.toml#4817
jdx merged 1 commit intomainfrom
use-env

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Apr 10, 2025

I just hit a situation where I had set MISE_ENV=macos globally. This meant that mise use started writing to mise.macos.toml which I did not want.

I am not sure why I had this logic in the first place but it doesn't seem ideal. It seems to me if you specify mise use -E macos that should write to mise.macos.toml but not if it's just an env var.

@roele I know you worked on this code a bit in #4249 but I think it was more about making the --path flag work correctly. Any concerns about this change?

@roele
Copy link
Copy Markdown
Contributor

roele commented Apr 10, 2025

Writing to mise.{env}.toml should be explicit via --env flag, so removing MISE_ENV makes sense. No objections from my side.

@jdx jdx merged commit e945bd4 into main Apr 10, 2025
19 checks passed
@jdx jdx deleted the use-env branch April 10, 2025 16:21
jdx pushed a commit that referenced this pull request Apr 11, 2025
### 🚀 Features

- **(registry)** update aws-nuke backend by
[@StingRayZA](https://github.com/StingRayZA) in
[#4815](#4815)

### 🐛 Bug Fixes

- do not default to writing to mise.$MISE_ENV.toml by
[@jdx](https://github.com/jdx) in
[#4817](#4817)
- mise watch forward --exts and --filter to watchexec by
[@cmhms](https://github.com/cmhms) in
[#4826](#4826)

### 📚 Documentation

- Fixing typo in code for flags in toml-tasks.md by
[@arafays](https://github.com/arafays) in
[#4820](#4820)
- branding by [@jdx](https://github.com/jdx) in
[9ad2c17](9ad2c17)
- remove references to not-working docker: tasks by
[@jdx](https://github.com/jdx) in
[2c2fd27](2c2fd27)
- document some dependencies by [@jdx](https://github.com/jdx) in
[6e8bd51](6e8bd51)

### 📦️ Dependency Updates

- update dependency vitepress-plugin-tabs to ^0.7.0 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#4822](#4822)
- update rust crate petgraph to 0.8 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#4823](#4823)
- update rust crate strum to 0.27 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#4780](#4780)

### New Contributors

- @cmhms made their first contribution in
[#4826](#4826)
- @StingRayZA made their first contribution in
[#4815](#4815)
@php-coder
Copy link
Copy Markdown

php-coder commented Apr 14, 2025

I've reported a similar issue (#4631) but when env-specific file is present. Does this PR fixes that case? Otherwise, perhaps, we should fix it as well.

@php-coder
Copy link
Copy Markdown

php-coder commented Apr 14, 2025

BTW it seems like we also need to update --help output:

$ mise use --help | head -15
Installs a tool and adds the version to mise.toml.

This will install the tool version if it is not already installed.
By default, this will use a `mise.toml` file in the current directory.

In the following order:
  - If `MISE_DEFAULT_CONFIG_FILENAME` is set, it will use that instead.
  - If `MISE_OVERRIDE_CONFIG_FILENAMES` is set, it will the first from that list.
  - If `MISE_ENV` is set, it will use a `mise.<env>.toml` instead.
  - Otherwise just "mise.toml"

Use the `--global` flag to use the global config file instead.

Usage: mise use [OPTIONS] [TOOL@VERSION]...

Note to the line "If MISE_ENV is set, it will use a mise.<env>.toml instead."

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.

3 participants