asdf-rust icon indicating copy to clipboard operation
asdf-rust copied to clipboard

PATH addition missing

Open cw-1988 opened this issue 6 months ago • 0 comments

Provide environment information

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

BASH VERSION:
5.2.21(1)-release

ASDF VERSION:
v0.17.0 (revision fc87e22)

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=$HOME/.asdf
ASDF_CONFIG_FILE=$HOME/.asdfrc

ASDF INSTALLED PLUGINS:
rust       https://github.com/code-lever/asdf-rust.git
           95acf4fe65df1de74fca502482b8f3ac5af73c05

To Reproduce

bash commands:

asdf plugin add rust asdf install rust 1.87.0 asdf set -u rust 1.87.0 ( I don't think the issue can be global install, but it might) cargo install jsonschema-cli jsonschema-cli --help

Describe the Bug

[[ ":$PATH:" != *":$HOME/.asdf/installs/rust/1.87.0/bin:"* ]] && echo 'export PATH="$HOME/.asdf/installs/rust/1.87.0/bin:$PATH"' >>"$HOME/.bashrc"

is kinda missing when you want to use cli tools installed via cargo

Expected Behaviour

[[ ":$PATH:" != *":$HOME/.asdf/installs/rust/1.87.0/bin:"* ]] && echo 'export PATH="$HOME/.asdf/installs/rust/1.87.0/bin:$PATH"' >>"$HOME/.bashrc"

should be added on version set and removed on plugin remove I guess it needs a rust version variable that is set by

RUST_VERSION="$(asdf list "rust" | grep "*" | sed 's/[ *]//g')"

with an escape when no version is set. i don't have too much knowledge on plugin development. so i guess it will be easier for you to add that, if asdf plugin supports that, but i hope and think it does.

If you have too much to do, let me know, then i get into it ;-)

cw-1988 avatar Jun 08 '25 19:06 cw-1988