asdf-community / asdf-community/asdf-rust

PATH addition missing

Open
#39 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
120
Forks
24
PR merge metrics
No merged PRs in 30d

Description

### Provide environment information

```bash
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 ;-)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the asdf-rust plugin's handling of version selection and plugin removal, then reproduce the reported flow with `asdf set -u rust 1.87.0` and `cargo install jsonschema-cli`. Check how the selected Rust version's bin directory is exposed to PATH, and verify that it is added on version set and removed on plugin removal.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, shell
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.