Avoid trying to install svgbob when already installed

This commit is contained in:
Michael Vines
2018-11-26 15:40:39 -08:00
parent c7f678688d
commit 58e3dd4cb6

View File

@ -13,15 +13,20 @@ _() {
} }
maybe_install() { maybe_install() {
for cmd in "$@"; do declare cmd=$1
declare crate=$2
if [[ -z $crate ]]; then
crate=$cmd
fi
set +e set +e
"$cmd" --help > /dev/null 2>&1 "$cmd" --help > /dev/null 2>&1
declare exitcode=$? declare exitcode=$?
set -e set -e
if [[ $exitcode -ne 0 ]]; then if [[ $exitcode -ne 0 ]]; then
_ cargo install "$cmd" _ cargo install "$crate"
fi fi
done
} }
_ cargo build --all --verbose _ cargo build --all --verbose
@ -47,7 +52,7 @@ done
# Build the HTML # Build the HTML
export PATH=$CARGO_HOME/bin:$PATH export PATH=$CARGO_HOME/bin:$PATH
maybe_install mdbook maybe_install mdbook
maybe_install svgbob_cli maybe_install svgbob svgbob_cli
_ make -C book _ make -C book
echo --- ci/localnet-sanity.sh echo --- ci/localnet-sanity.sh