#!/bin/bash
# Set up the appropriate rustc toolchain
+set -e
+
cd "$(dirname "$0")"
-if ! command -v rustup-toolchain-install-master > /dev/null; then
- cargo install rustup-toolchain-install-master --debug
+if [[ "$CI" == true ]] || ! command -v rustup-toolchain-install-master > /dev/null; then
+ cargo install -Z install-upgrade rustup-toolchain-install-master --bin rustup-toolchain-install-master
fi
-RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
-rustup-toolchain-install-master -f -n master "$RUSTC_HASH"
+rustup-toolchain-install-master -f -n master
rustup override set master