Skip to content

Closes #279: use $CARGO_HOME as default location if defined #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mh182
Copy link

@mh182 mh182 commented Mar 30, 2025

I added a 2nd commit which addresses unquoted variables names preventing shell globbing or word splitting.

@Byron Byron linked an issue Mar 30, 2025 that may be closed by this pull request
Copy link
Owner

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for making this happen, it's much appreciated!

Once this is finalised I think the changes should also be contributed to the source of this copy for maximum impact.

if [ -z $dest ]; then
dest="$HOME/.cargo/bin"
if [ -z "$dest" ]; then
dest="${CARGO_HOME:-$HOME/.cargo/bin}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem correct as per the definition of $CARGO_HOME.

This seems more like it.

Suggested change
dest="${CARGO_HOME:-$HOME/.cargo/bin}"
dest="${CARGO_HOME:-$HOME/.cargo}/bin"

What do you think?

@@ -16,7 +16,7 @@ Options:
--crate NAME Name of the crate to install (default <repository name>)
--tag TAG Tag (version) of the crate to install (default <latest release>)
--target TARGET Install the release compiled for $TARGET (default <`rustc` host>)
--to LOCATION Where to install the binary (default ~/.cargo/bin)
--to LOCATION Where to install the binary (default '$CARGO_HOME' if defined, otherwise '~/.cargo/bin')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
--to LOCATION Where to install the binary (default '$CARGO_HOME' if defined, otherwise '~/.cargo/bin')
--to LOCATION Where to install the binary (default '$CARGO_HOME/bin' if defined, otherwise '~/.cargo/bin')

More context is in the comment below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installation should take CARGO_HOME into account for default location
2 participants