about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/ci
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2018-02-17 20:24:48 -0800
committerWho? Me?! <mark-i-m@users.noreply.github.com>2018-02-17 22:35:40 -0600
commita2a18373cd7a0578674b8f273696dfdb46168f05 (patch)
treec923fd8ef48a13bdcac5292e034cfd6ac8f3a7ad /src/doc/rustc-dev-guide/ci
parent468407fc7440c385cd407f9d1a03e9d91d3a7e56 (diff)
downloadrust-a2a18373cd7a0578674b8f273696dfdb46168f05.tar.gz
rust-a2a18373cd7a0578674b8f273696dfdb46168f05.zip
Force mdbook update on CI if there is a version mismatch.
Fixes #58.
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
 }