rustup cargo install-upgrade

This commit is contained in:
Lzu Tao 2019-11-27 16:32:51 +07:00
parent cc35165f52
commit 6173478cf8
3 changed files with 7 additions and 8 deletions

View File

@ -12,7 +12,7 @@ cache:
directories:
- $HOME/.cargo
before_cache:
- cargo install -Z install-upgrade cargo-cache --debug
- cargo install cargo-cache --debug
- find $HOME/.cargo/bin/ ! -type d -exec strip {} \;
- cargo cache --autoclean
@ -28,7 +28,7 @@ install:
- |
if [[ -z ${INTEGRATION} ]]; then
if ! rustup component add rustfmt; then
cargo install -Z install-upgrade --git https://github.com/rust-lang/rustfmt --bin rustfmt
cargo install --git https://github.com/rust-lang/rustfmt --bin rustfmt
fi
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
. $HOME/.nvm/nvm.sh

View File

@ -18,7 +18,7 @@ cache:
- '%USERPROFILE%\.cargo'
# before cache
after_test:
- cargo install -Z install-upgrade cargo-cache --debug
- cargo install cargo-cache --debug
- cargo cache --autoclean
install:
@ -27,7 +27,7 @@ install:
- set PATH=%USERPROFILE%\.cargo\bin;%PATH%
- rustup component add rustfmt --toolchain nightly & exit 0 # Format test handles missing rustfmt
- del rust-toolchain
- cargo install -Z install-upgrade rustup-toolchain-install-master
- cargo install rustup-toolchain-install-master
- rustup-toolchain-install-master -f -n master -c rustc-dev
- rustup override set master
- rustc -V

View File

@ -5,14 +5,13 @@ set -e
cd "$(dirname "$0")"
ERRNO=0
RTIM_PATH=$(command -v rustup-toolchain-install-master) || ERRNO=$?
RTIM_PATH=$(command -v rustup-toolchain-install-master)
CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}
# Check if people also install RTIM in other locations beside
# ~/.cargo/bin
if [[ "$ERRNO" -ne 0 ]] || [[ "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-install-master ]]; then
cargo install -Z install-upgrade rustup-toolchain-install-master
if [[ "$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.]*")
REMOTE=$(cargo search rustup-toolchain-install-master | grep -o "[0-9.]*")