From d9af4482551b8e576cbbb90bb9c68fdec456b1db Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Thu, 28 Nov 2019 18:12:01 +0700 Subject: [PATCH] build: check if RTIM is not installed --- setup-toolchain.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup-toolchain.sh b/setup-toolchain.sh index 9110d7dbffc..2388f94ae66 100755 --- a/setup-toolchain.sh +++ b/setup-toolchain.sh @@ -5,12 +5,11 @@ set -e 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} -# Check if people also install RTIM in other locations beside -# ~/.cargo/bin -if [[ "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-install-master ]]; then +# Check if RTIM is not installed or installed in other locations not in ~/.cargo/bin +if [[ "$INSTALLED" == false || "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-install-master ]]; then cargo +nightly install rustup-toolchain-install-master else VERSION=$(rustup-toolchain-install-master -V | grep -o "[0-9.]*") -- 2.44.0