Force mdbook update on CI if there is a version mismatch.

Fixes #58.
This commit is contained in:
Eric Huss 2018-02-17 20:24:48 -08:00 committed by Who? Me?!
parent 49da9c9030
commit 723222974d
1 changed files with 8 additions and 2 deletions

View File

@ -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 "Installing $name"
echo "Forcing install $name $version"
cargo install $name --version $version --force
fi
else
echo "Installing $name $version"
cargo install $name --version $version
fi
}