Skip to content

Commit

Permalink
Do not install rustup-toolchain if it is in PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Jun 3, 2019
1 parent b0ec33f commit 3fb497c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions setup-toolchain.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash
# Set up the appropriate rustc toolchain

cd $(dirname $0)
cd "$(dirname "$0")"

if ! command -v rustup-toolchain-install-master > /dev/null; then
cargo install rustup-toolchain-install-master --debug
fi

cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
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 "$RUSTC_HASH"
rustup override set master

0 comments on commit 3fb497c

Please sign in to comment.