diff options
Diffstat (limited to 'install.sh')
| -rwxr-xr-x | install.sh | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -87,6 +87,8 @@ echo "Cloning Rustlings at $Path..." git clone -q https://github.com/rust-lang/rustlings $Path Version=$(curl -s https://api.github.com/repos/rust-lang/rustlings/releases/latest | python -c "import json,sys;obj=json.load(sys.stdin);print(obj['tag_name']);") +CargoBin="${CARGO_HOME:-$HOME/.cargo}/bin" + echo "Checking out version $Version..." cd $Path git checkout -q tags/$Version @@ -96,7 +98,16 @@ cargo install --force --path . if ! [ -x "$(command -v rustlings)" ] then - echo "WARNING: Please check that you have '~/.cargo/bin' in your PATH environment variable!" + echo "WARNING: Please check that you have '$CargoBin' in your PATH environment variable!" +fi + +# Checking whether Clippy is installed. +# Due to a bug in Cargo, this must be done with Rustup: https://github.com/rust-lang/rustup/issues/1514 +Clippy=$(rustup component list | grep "clippy" | grep "installed") +if [ -z "$Clippy" ] +then + echo "Installing the 'cargo-clippy' executable..." + rustup component add clippy fi echo "All done! Run 'rustlings' to get started." |
