Skip to content

Commit 4af21aa

Browse files
ehussmark-i-m
authored andcommitted
Force mdbook update on CI if there is a version mismatch.
Fixes rust-lang#58.
1 parent c7c80ab commit 4af21aa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ci/install.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ function cargo_install() {
66
local version=$2
77

88
if command -v $name >/dev/null 2>&1; then
9-
echo "$name is already installed at $(command -v $name)"
9+
local installed_version=`$name --version | sed -E 's/[a-zA-Z_-]+ v?//g'`
10+
if [ "$installed_version" == "$version" ]; then
11+
echo "$name $version is already installed at $(command -v $name)"
12+
else
13+
echo "Forcing install $name $version"
14+
cargo install $name --version $version --force
15+
fi
1016
else
11-
echo "Installing $name"
17+
echo "Installing $name $version"
1218
cargo install $name --version $version
1319
fi
1420
}

0 commit comments

Comments
 (0)