about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/ci
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc/rustc-dev-guide/ci')
-rw-r--r--src/doc/rustc-dev-guide/ci/install.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/doc/rustc-dev-guide/ci/install.sh b/src/doc/rustc-dev-guide/ci/install.sh
index 99c85986cbb..a5d87a6bc3b 100644
--- a/src/doc/rustc-dev-guide/ci/install.sh
+++ b/src/doc/rustc-dev-guide/ci/install.sh
@@ -6,9 +6,15 @@ function cargo_install() {
   local version=$2
 
   if command -v $name >/dev/null 2>&1; then
-    echo "$name is already installed at $(command -v $name)"
+    local installed_version=`$name --version | sed -E 's/[a-zA-Z_-]+ v?//g'`
+    if [ "$installed_version" == "$version" ]; then
+        echo "$name $version is already installed at $(command -v $name)"
+    else
+        echo "Forcing install $name $version"
+        cargo install $name --version $version --force
+    fi
   else
-    echo "Installing $name"
+    echo "Installing $name $version"
     cargo install $name --version $version
   fi
 }