Skip to content

Commit

Permalink
fix: correct mise use ordering (#2234)
Browse files Browse the repository at this point in the history
Fixes #2232
  • Loading branch information
jdx authored May 31, 2024
1 parent 8dcf0f3 commit 62f20db
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/cli/settings/unset.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use eyre::Result;
use toml_edit::DocumentMut;

use crate::{config::settings::SettingsFile, env, file};
use crate::config::settings::SettingsFile;
use crate::{env, file};

/// Clears a setting
///
Expand Down
6 changes: 6 additions & 0 deletions src/cli/use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ mod tests {
tiny = "2"
"###);

assert_cli_snapshot!("use", "tiny@1", "tiny@2", "tiny@3", @"mise ~/cwd/.test.mise.toml tools: [email protected], [email protected], [email protected]");
assert_snapshot!(file::read_to_string(&cf_path).unwrap(), @r###"
[tools]
tiny = ["1", "2", "3"]
"###);

assert_cli_snapshot!("use", "--pin", "tiny", @"mise ~/cwd/.test.mise.toml tools: [email protected]");
assert_snapshot!(file::read_to_string(&cf_path).unwrap(), @r###"
[tools]
Expand Down
2 changes: 1 addition & 1 deletion src/config/config_file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub fn trust_check(path: &Path) -> eyre::Result<()> {
return Ok(());
}
if cmd != "hook-env" {
let ans = prompt::confirm(format!(
let ans = prompt::confirm_with_all(format!(
"{} {} is not trusted. Trust it?",
style::eyellow("mise"),
style::epath(path)
Expand Down
2 changes: 1 addition & 1 deletion src/toolset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl Toolset {
Err(e) => panic::resume_unwind(e),
})
.collect::<Result<Vec<Vec<ToolVersion>>>>()
.map(|x| x.into_iter().flatten().collect())
.map(|x| x.into_iter().flatten().rev().collect())
})?;
trace!("install: resolving");
if let Err(err) = self.resolve() {
Expand Down

0 comments on commit 62f20db

Please sign in to comment.