use cargo install

This commit is contained in:
Mark Mansi 2020-01-30 14:01:42 -06:00 committed by Who? Me?!
parent ebcb920d64
commit 0740d946f7
2 changed files with 2 additions and 25 deletions

View File

@ -10,7 +10,8 @@ before_install:
- MAX_LINE_LENGTH=100 bash ci/check_line_lengths.sh src/**/*.md
install:
- source ~/.cargo/env || true
- bash -x ci/install.sh
- cargo install mdbook --version 0.3.4
- cargo install mdbook-linkcheck --version 0.5.0
script:
- mdbook build
notifications:

View File

@ -1,24 +0,0 @@
#!/bin/bash
set -ex
function cargo_install() {
local name=$1
local version=$2
if command -v $name >/dev/null 2>&1; then
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 $version"
cargo install $name --version $version
fi
}
cargo_install mdbook 0.3.4
cargo_install mdbook-linkcheck 0.5.0