From 69f5b95fa7e7caaa4970e4da24c6e581cb3de5a4 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 17 Feb 2018 20:24:48 -0800 Subject: [PATCH] Force mdbook update on CI if there is a version mismatch. Fixes #58. --- ci/install.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ci/install.sh b/ci/install.sh index 99c85986c..a5d87a6bc 100644 --- a/ci/install.sh +++ b/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 }