build: check if RTIM is not installed

This commit is contained in:
Lzu Tao 2019-11-28 18:12:01 +07:00
parent b5a6714155
commit d9af448255

View File

@ -5,12 +5,11 @@ set -e
cd "$(dirname "$0")" cd "$(dirname "$0")"
RTIM_PATH=$(command -v rustup-toolchain-install-master) RTIM_PATH=$(command -v rustup-toolchain-install-master) || INSTALLED=false
CARGO_HOME=${CARGO_HOME:-$HOME/.cargo} CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}
# Check if people also install RTIM in other locations beside # Check if RTIM is not installed or installed in other locations not in ~/.cargo/bin
# ~/.cargo/bin if [[ "$INSTALLED" == false || "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-install-master ]]; then
if [[ "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-install-master ]]; then
cargo +nightly install rustup-toolchain-install-master cargo +nightly install rustup-toolchain-install-master
else else
VERSION=$(rustup-toolchain-install-master -V | grep -o "[0-9.]*") VERSION=$(rustup-toolchain-install-master -V | grep -o "[0-9.]*")