Skip to content

Commit

Permalink
fix: use mise.toml instead of .mise.toml by default in mise use
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Nov 6, 2024
1 parent 448e205 commit 3dc5e00
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/cli/use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ impl Use {

fn get_config_file(&self) -> Result<Box<dyn ConfigFile>> {
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 {
Expand Down
4 changes: 2 additions & 2 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ fn load_legacy_files() -> BTreeMap<String, Vec<String>> {
}

pub static LOCAL_CONFIG_FILENAMES: Lazy<Vec<&'static str>> = 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",
Expand All @@ -579,8 +579,8 @@ pub static LOCAL_CONFIG_FILENAMES: Lazy<Vec<&'static str>> = 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",
Expand Down
2 changes: 1 addition & 1 deletion src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub static MISE_DEFAULT_TOOL_VERSIONS_FILENAME: Lazy<String> = Lazy::new(|| {
var("MISE_DEFAULT_TOOL_VERSIONS_FILENAME").unwrap_or_else(|_| ".tool-versions".into())
});
pub static MISE_DEFAULT_CONFIG_FILENAME: Lazy<String> =
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<Option<String>> = Lazy::new(|| environment(&ARGS.read().unwrap()));
pub static MISE_SETTINGS_FILE: Lazy<PathBuf> = Lazy::new(|| {
var_path("MISE_SETTINGS_FILE").unwrap_or_else(|| MISE_CONFIG_DIR.join("settings.toml"))
Expand Down

0 comments on commit 3dc5e00

Please sign in to comment.