Prevent failing to restart setup-toolchain

If `rustup-toolchain-install-master` fails to install master
toolchain (in case `rustup update` executes at the same remove the
tmp directory), `cargo search` (which use master toolchain after
`rustup override` command) will fail. This leads to setup-toolchain
fails too.
This commit is contained in:
Lzu Tao 2020-02-05 20:37:33 +07:00
parent c881aca282
commit 46df9716af

View file

@ -13,7 +13,7 @@ if [[ "$INSTALLED" == false || "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-
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.]*")
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 "info: skipping updating rustup-toolchain-install-master at $RTIM_PATH"
echo " current version : $VERSION" echo " current version : $VERSION"
echo " remote version : $REMOTE" echo " remote version : $REMOTE"