From 3dc5e00956a7ea521c81377f8ccf021c56a9fb9b Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:00:39 -0500 Subject: [PATCH] fix: use mise.toml instead of .mise.toml by default in `mise use` --- src/cli/use.rs | 4 ++-- src/config/mod.rs | 4 ++-- src/env.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cli/use.rs b/src/cli/use.rs index 8709d767b4..871a40b001 100644 --- a/src/cli/use.rs +++ b/src/cli/use.rs @@ -147,11 +147,11 @@ impl Use { fn get_config_file(&self) -> Result> { let path = if let Some(env) = &*env::MISE_ENV { - config_file_from_dir(&env::current_dir()?.join(format!(".mise.{}.toml", env))) + config_file_from_dir(&env::current_dir()?.join(format!("mise.{}.toml", env))) } else if self.global { MISE_GLOBAL_CONFIG_FILE.clone() } else if let Some(env) = &self.env { - config_file_from_dir(&env::current_dir()?.join(format!(".mise.{}.toml", env))) + config_file_from_dir(&env::current_dir()?.join(format!("mise.{}.toml", env))) } else if let Some(p) = &self.path { config_file_from_dir(p) } else { diff --git a/src/config/mod.rs b/src/config/mod.rs index ff4d2f4411..e66aba1cff 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -570,7 +570,7 @@ fn load_legacy_files() -> BTreeMap> { } pub static LOCAL_CONFIG_FILENAMES: Lazy> = Lazy::new(|| { - if *env::MISE_DEFAULT_CONFIG_FILENAME == ".mise.toml" { + if *env::MISE_DEFAULT_CONFIG_FILENAME == "mise.toml" { vec![ &*env::MISE_DEFAULT_TOOL_VERSIONS_FILENAME, // .tool-versions ".config/mise/config.toml", @@ -579,8 +579,8 @@ pub static LOCAL_CONFIG_FILENAMES: Lazy> = Lazy::new(|| { "mise/config.toml", ".mise/config.toml", ".rtx.toml", - "mise.toml", &*env::MISE_DEFAULT_CONFIG_FILENAME, // .mise.toml + ".mise.toml", ".config/mise/config.local.toml", ".config/mise.local.toml", ".mise/config.local.toml", diff --git a/src/env.rs b/src/env.rs index 1b6fb2c13a..cea846b573 100644 --- a/src/env.rs +++ b/src/env.rs @@ -83,7 +83,7 @@ pub static MISE_DEFAULT_TOOL_VERSIONS_FILENAME: Lazy = Lazy::new(|| { var("MISE_DEFAULT_TOOL_VERSIONS_FILENAME").unwrap_or_else(|_| ".tool-versions".into()) }); pub static MISE_DEFAULT_CONFIG_FILENAME: Lazy = - Lazy::new(|| var("MISE_DEFAULT_CONFIG_FILENAME").unwrap_or_else(|_| ".mise.toml".into())); + Lazy::new(|| var("MISE_DEFAULT_CONFIG_FILENAME").unwrap_or_else(|_| "mise.toml".into())); pub static MISE_ENV: Lazy> = Lazy::new(|| environment(&ARGS.read().unwrap())); pub static MISE_SETTINGS_FILE: Lazy = Lazy::new(|| { var_path("MISE_SETTINGS_FILE").unwrap_or_else(|| MISE_CONFIG_DIR.join("settings.toml"))