diff --git a/.mise.lock b/.mise.lock new file mode 100644 index 0000000000..4f8e70b0a4 --- /dev/null +++ b/.mise.lock @@ -0,0 +1,18 @@ +[tools] +actionlint = "1.7.4" +cargo-binstall = "1.10.10" +"cargo:cargo-edit" = "0.13.0" +"cargo:cargo-insta" = "1.41.1" +"cargo:cargo-show" = "0.6.0" +"cargo:git-cliff" = "2.6.1" +"cargo:usage-cli" = "1.1.1" +direnv = "latest" +jq = "1.7.1" +"npm:markdownlint-cli" = "0.42.0" +"npm:prettier" = "3.3.3" +"pipx:toml-sort" = "0.23.1" +python = "3.10.15" +ripgrep = "14.1.1" +shellcheck = "0.10.0" +shfmt = "3.10.0" +tiny = "2.1.0" diff --git a/.mise.toml b/.mise.toml index 100e1ac43a..aeee92f249 100644 --- a/.mise.toml +++ b/.mise.toml @@ -9,8 +9,6 @@ FOO_NUM = 1 THIS_PROJECT = "{{config_root}}-{{cwd}}" [tools] -#node = 'lts' -python = { version = "latest" } shellcheck = "0.10" shfmt = "3" jq = "latest" @@ -26,6 +24,8 @@ actionlint = "latest" ripgrep = "latest" "pipx:toml-sort" = "latest" "cargo:usage-cli" = "1.2" +python = ["3.11", "3.10"] +tiny = ["1", "2"] #python = { version = "latest", virtualenv = "{{env.HOME}}/.cache/venv" } #ruby = "3.1" diff --git a/e2e/lockfile/test_lockfile_use b/e2e/lockfile/test_lockfile_use index 31e6a4c4e2..28685944e1 100644 --- a/e2e/lockfile/test_lockfile_use +++ b/e2e/lockfile/test_lockfile_use @@ -30,3 +30,11 @@ assert "cat .mise.lock" '[tools] tiny = "3.1.0"' assert "mise ls tiny --json --current | jq -r '.[0].requested_version'" "3" assert "mise ls tiny --json --current | jq -r '.[0].version'" "3.1.0" + +mise use tiny@1 tiny@2 +assert "cat .mise.lock" '[tools] +tiny = ["1.0.0", "2.1.0"]' +assert "mise ls tiny --json --current | jq -r '.[0].requested_version'" "1" +assert "mise ls tiny --json --current | jq -r '.[0].version'" "1.0.0" +assert "mise ls tiny --json --current | jq -r '.[1].requested_version'" "2" +assert "mise ls tiny --json --current | jq -r '.[1].version'" "2.1.0" diff --git a/src/lockfile.rs b/src/lockfile.rs index e96e25c483..aca7e0c724 100644 --- a/src/lockfile.rs +++ b/src/lockfile.rs @@ -13,7 +13,7 @@ use std::sync::Mutex; #[derive(Debug, Default, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct Lockfile { - tools: BTreeMap, + tools: BTreeMap>, } impl Lockfile { @@ -94,6 +94,7 @@ pub fn update_lockfiles(new_versions: &[ToolVersion]) -> Result<()> { .retain(|k, _| all_tool_names.contains(k) || SETTINGS.disable_tools.contains(k)); for (short, tvl) in tools { + dbg!(short, tvl); for tv in &tvl.versions { existing_lockfile .tools