dua-cli icon indicating copy to clipboard operation
dua-cli copied to clipboard

Installation should take CARGO_HOME into account for default location

Open mh182 opened this issue 8 months ago • 1 comments

I have configured CARGO_HOME to be $HOME/.cache/cargo and installed dua following the installation instructions. The target location where dua ended was a surprise for me.

Following the pattern of least astonishment I would have expected to end up in $CARGO_HOME/bin.

➜ echo $CARGO_HOME
/home/max/.cache/cargo
➜ curl -LSfs https://raw.githubusercontent.com/Byron/dua-cli/master/ci/install.sh | \
    sh -s -- --git Byron/dua-cli --target x86_64-unknown-linux-musl --crate dua --tag v2.29.0
install.sh: GitHub repository: https://github.com/Byron/dua-cli
install.sh: Crate: dua
install.sh: Tag: v2.29.0
install.sh: Target: x86_64-unknown-linux-musl
install.sh: Installing to: /home/max/.cargo/bin
install.sh: Downloading: https://github.com/Byron/dua-cli/releases/download/v2.29.0/dua-v2.29.0-x86_64-unknown-linux-musl.tar.gz
'/tmp/tmp.GSDRgpom8t/./dua-v2.29.0-x86_64-unknown-linux-musl/dua' -> '/home/max/.cargo/bin/dua'

Suggestion: if CARGO_HOME is defined, use it a default location.

mh182 avatar Mar 29 '25 08:03 mh182

Thanks for reporting!

This might be due to an outdated install.sh script which I believe originates here. The original also seems to ignore CARGO_HOME, and this line seems to be responsible.

One could probably submit a PR there for maximum impact, and then update the script here.

Byron avatar Mar 30 '25 00:03 Byron