From c9cfdaa4b2362e73da83bf4e619c5ad5ab7837f9 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Wed, 27 Nov 2024 13:56:59 -0600 Subject: [PATCH] fix: rust idiomatic file parsing --- docs/registry.md | 3 +-- e2e/plugins/core/test_rust | 9 ++++++++- registry.toml | 4 ++-- src/plugins/core/rust.rs | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/registry.md b/docs/registry.md index 60de37a5de..e988031fbc 100644 --- a/docs/registry.md +++ b/docs/registry.md @@ -219,8 +219,7 @@ You can also specify the full name for a tool using `mise use aqua:1password/cli | elasticsearch | [asdf:asdf-community/asdf-elasticsearch](https://github.com/asdf-community/asdf-elasticsearch) | | elixir | [asdf:mise-plugins/mise-elixir](https://github.com/mise-plugins/mise-elixir) [vfox:version-fox/vfox-elixir](https://github.com/version-fox/vfox-elixir) | | elixir-ls | [asdf:juantascon/asdf-elixir-ls](https://github.com/juantascon/asdf-elixir-ls) | -| elm | [asdf:asdf-community/asdf-elm](https://github.com/asdf-community/asdf-elm) | -| embulk | [asdf:yuokada/asdf-embulk](https://github.com/yuokada/asdf-embulk) | +| elm | [ubi:elm/compiler](https://github.com/elm/compiler) [asdf:asdf-community/asdf-elm](https://github.com/asdf-community/asdf-elm) | | emsdk | [asdf:RobLoach/asdf-emsdk](https://github.com/RobLoach/asdf-emsdk) | | envcli | [asdf:zekker6/asdf-envcli](https://github.com/zekker6/asdf-envcli) | | envsubst | [aqua:a8m/envsubst](https://github.com/a8m/envsubst) [asdf:dex4er/asdf-envsubst](https://github.com/dex4er/asdf-envsubst) | diff --git a/e2e/plugins/core/test_rust b/e2e/plugins/core/test_rust index 9be09ac30e..8f85ae061a 100644 --- a/e2e/plugins/core/test_rust +++ b/e2e/plugins/core/test_rust @@ -3,4 +3,11 @@ export MISE_RUSTUP_HOME="$MISE_DATA_DIR/rustup" export MISE_CARGO_HOME="$MISE_DATA_DIR/cargo" -assert_contains "mise x rust@1.82.0 -- rustc --version" "rustc 1.82.0" +assert_contains "mise x rust@1.81.0 -- rustc --version" "rustc 1.81.0" + +cat <rust-toolchain.toml +[toolchain] +channel = "1.81.0" +EOF + +assert_contains "mise x -- rustc --version" "rustc 1.81.0" diff --git a/registry.toml b/registry.toml index df930b9433..3c807e2760 100644 --- a/registry.toml +++ b/registry.toml @@ -306,8 +306,8 @@ elasticsearch.backends = ["asdf:asdf-community/asdf-elasticsearch"] elixir.backends = ["asdf:mise-plugins/mise-elixir", "vfox:version-fox/vfox-elixir"] elixir.depends = ["erlang"] elixir-ls.backends = ["asdf:juantascon/asdf-elixir-ls"] -elm.backends = ["asdf:asdf-community/asdf-elm"] -embulk.backends = ["asdf:yuokada/asdf-embulk"] +elm.backends = ["ubi:elm/compiler[exe=elm]", "asdf:asdf-community/asdf-elm"] +elm.test = ["elm --version", "{{version}}"] emsdk.backends = ["asdf:RobLoach/asdf-emsdk"] envcli.backends = ["asdf:zekker6/asdf-envcli"] envsubst.backends = ["aqua:a8m/envsubst", "asdf:dex4er/asdf-envsubst"] diff --git a/src/plugins/core/rust.rs b/src/plugins/core/rust.rs index ba599b04c4..584f489a4f 100644 --- a/src/plugins/core/rust.rs +++ b/src/plugins/core/rust.rs @@ -81,7 +81,7 @@ impl Backend for RustPlugin { let toml = toml.parse::()?; if let Some(toolchain) = toml.get("toolchain") { if let Some(channel) = toolchain.get("channel") { - return Ok(channel.to_string()); + return Ok(channel.as_str().unwrap().to_string()); } } Ok("".into()) @@ -100,7 +100,7 @@ impl Backend for RustPlugin { .execute()?; file::remove_all(tv.install_path())?; - file::make_symlink(&cargo_home().join(&tv.version), &tv.install_path())?; + file::make_symlink(&cargo_home().join("bin"), &tv.install_path())?; self.test_rust(ctx, &tv)?;