-
-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: added MISE_OVERRIDE_CONFIG_FILENAMES config (#3266)
Before this change, MISE_DEFAULT_CONFIG_FILENAME and MISE_DEFAULT_TOOL_VERSIONS_FILENAME accomplished 2 things where it should only have been doing one. These commands both ignored "mise.toml"/".tool-versions" (but only that one filename) if set and also changed the default location for commands like `mise use` to write to. This made it so you could not set MISE_DEFAULT_CONFIG_FILENAME=.mise.local.toml if you always want to use that file without also ignoring any "mise.toml" files. This change adds 2 new env vars, MISE_OVERRIDE_CONFIG_FILENAMES and MISE_OVERRIDE_TOOL_VERSIONS_FILENAMES which can be arrays of filenames. If these are set, mise will not load any local filenames (globals are still loaded, use MISE_CONFIG_FILE to change that) and instead mise will use those filenames. For the common pattern of just wanting to ignore .tool-versions you can set MISE_OVERRIDE_TOOL_VERSIONS_FILENAMES=none Fixes #1901 BREAKING CHANGE: This causes mise to start reading mise.toml if MISE_DEFAULT_CONFIG_FILENAME was set previously which it did not before. This change also changes the behavior slightly for writing new config files. Before it was not consistent across commands like `mise settings -l` and `mise use` but now it will use the following order if no file exists and it needs to create one: - if MISE_DEFAULT_CONFIG_FILENAME is set, create that - if MISE_OVERRIDE_CONFIG_FILENAMES has anything, use the first. - if MISE_ENV is set, create "mise.$MISE_ENV.toml" - else, create "mise.toml" If you have not been using any of these env vars nothing should change.
- Loading branch information
Showing
12 changed files
with
171 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
# Profiles | ||
# Config Environments | ||
|
||
It's possible to have separate `mise.toml` files in the same directory for different | ||
environments like `development` and `production`. To enable, either set the `-P,--profile` option or `MISE_PROFILE` environment | ||
variable to an environment like `development` or `production`. mise will then look for a `mise.{MISE_PROFILE}.toml` file | ||
environments like `development` and `production`. To enable, either set the `-E,--env` option or `MISE_ENV` environment | ||
variable to an environment like `development` or `production`. mise will then look for a `mise.{MISE_ENV}.toml` file | ||
in the current directory, parent directories and the `MISE_CONFIG_DIR` directory. | ||
|
||
mise will also look for "local" files like `mise.local.toml` and `mise.{MISE_PROFILE}.local.toml` | ||
mise will also look for "local" files like `mise.local.toml` and `mise.{MISE_ENV}.local.toml` | ||
in the current directory and parent directories. | ||
These are intended to not be committed to version control. | ||
(Add `mise.local.toml` and `mise.*.local.toml` to your `.gitignore` file.) | ||
|
||
The priority of these files goes in this order (top overrides bottom): | ||
|
||
- `mise.{MISE_PROFILE}.local.toml` | ||
- `mise.{MISE_ENV}.local.toml` | ||
- `mise.local.toml` | ||
- `mise.{MISE_PROFILE}.toml` | ||
- `mise.{MISE_ENV}.toml` | ||
- `mise.toml` | ||
|
||
You can also use paths like `mise/config.{MISE_PROFILE}.toml` or `.config/mise.{MISE_PROFILE}.toml` Those rules | ||
follow the order in [Configuration](./configuration.md). | ||
If `MISE_OVERRIDE_CONFIG_FILENAMES` is set, that will be used instead of all of this. | ||
|
||
You can also use paths like `mise/config.{MISE_ENV}.toml` or `.config/mise.{MISE_ENV}.toml` Those rules | ||
follow the order in [Configuration](/configuration). | ||
|
||
Use `mise config` to see which files are being used. | ||
|
||
::: warning | ||
Note that currently modifying `MISE_DEFAULT_CONFIG_FILENAME` to something other than `mise.toml` | ||
will not work with this feature. For now, it will disable it entirely. This may change in the | ||
future. | ||
::: | ||
The rules around which file is written are different because we ultimately need to choose one. See | ||
the docs for [`mise use`](/cli/use.html) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.