kernel icon indicating copy to clipboard operation
kernel copied to clipboard

install-env should detect if `xargo` is already installed

Open hawkw opened this issue 9 years ago • 2 comments

Currently, the install-env.sh script doesn't check if xargo is already installed before running cargo install xargo. I thought this would silently do nothing if xargo is already present, but it looks like it fails with an error message.

install-env: Installing `xargo`.

    Updating registry `https://github.com/rust-lang/crates.io-index`
error: binary `xargo` already exists in destination as part of `xargo v0.2.1`
Add --force to overwrite
make: *** [env] Error 101

While this doesn't really matter, since installing xargo is the last step in the install process and an early exit here doesn't result in us skipping anything important, it does lead the user to think that the install process has failed, when in fact, everything is fine. So it'd be nice to not try installing xargo if it's already present.

Thanks to @MxLinux for reporting this issue on Slack.

hawkw avatar Nov 08 '16 16:11 hawkw

This should be more or less trivial to implement - just run a quick command -v xargo to see if it's installed, and then test if the output is empty. We already do this when we're installing Rust, so whomever ends up working on this one has something to use as an example.

@rachlmac, do you want this one?

hawkw avatar Nov 08 '16 16:11 hawkw

@hawkw Yes! I will look into getting this updated, thanks.

rachlmac avatar Nov 08 '16 16:11 rachlmac