summaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/install.sh b/install.sh
index 85bdad7..7abb406 100755
--- a/install.sh
+++ b/install.sh
@@ -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."