-#!/bin/bash
+#!/usr/bin/env bash
# Set up the appropriate rustc toolchain
set -e
cargo +nightly install rustup-toolchain-install-master
else
VERSION=$(rustup-toolchain-install-master -V | grep -o "[0-9.]*")
- REMOTE=$(cargo search rustup-toolchain-install-master | grep -o "[0-9.]*")
+ REMOTE=$(cargo +nightly search rustup-toolchain-install-master | grep -o "[0-9.]*")
echo "info: skipping updating rustup-toolchain-install-master at $RTIM_PATH"
echo " current version : $VERSION"
echo " remote version : $REMOTE"
exit 0
fi
-rustup-toolchain-install-master -f -n master -c rustc-dev -- "$RUST_COMMIT"
+if [[ -n "$HOST_TOOLCHAIN" ]]; then
+ TOOLCHAIN=('--host' "$HOST_TOOLCHAIN")
+else
+ TOOLCHAIN=()
+fi
+
+rustup-toolchain-install-master -f -n master "${TOOLCHAIN[@]}" -c rustc-dev -- "$RUST_COMMIT"
rustup override set master