diff --git a/docs/profiles.md b/docs/profiles.md index 08e7c1494..058bcb867 100644 --- a/docs/profiles.md +++ b/docs/profiles.md @@ -10,10 +10,19 @@ 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 (bottom overrides top): +The priority of these files goes in this order (bottom overrides top). +Global configuration files: + +- `{MISE_CONFIG_DIR}/config.toml` +- `{MISE_CONFIG_DIR}/config.local.toml` - `{MISE_CONFIG_DIR}/config.{MISE_ENV}.toml` +- `{MISE_CONFIG_DIR}/config.{MISE_ENV}.local.toml` - `{MISE_CONFIG_DIR}/mise.{MISE_ENV}.toml` +- `{MISE_CONFIG_DIR}/mise.{MISE_ENV}.local.toml` + +Local configuration files: + - `.config/mise/config.toml` - `mise/config.toml` - `mise.toml` diff --git a/src/config/mod.rs b/src/config/mod.rs index dd5ba138c..192163db6 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -655,13 +655,18 @@ pub fn global_config_files() -> Vec { } }; let global_config = env::MISE_GLOBAL_CONFIG_FILE.clone(); - if global_config.is_file() { - config_files.push(global_config); + let global_local_config = global_config.with_extension("local.toml"); + for f in [global_config, global_local_config] { + if f.is_file() { + config_files.push(f); + } } if let Some(env) = &*env::MISE_ENV { let global_profile_files = vec![ dirs::CONFIG.join(format!("config.{env}.toml")), + dirs::CONFIG.join(format!("config.{env}.local.toml")), dirs::CONFIG.join(format!("mise.{env}.toml")), + dirs::CONFIG.join(format!("mise.{env}.local.toml")), ]; for f in global_profile_files { if f.is_file() {