Skip to content
This repository was archived by the owner on Oct 30, 2019. It is now read-only.

Commit f721ce9

Browse files
taiki-eyoshuawuyts
authored andcommitted
Use the latest toolchain with rustfmt available if rustfmt is unavailable on the latest nightly (#104)
1 parent e6d4fc6 commit f721ce9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ci/rustfmt.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ jobs:
88
parameters:
99
rust_version: nightly
1010
- script: |
11-
rustup component add rustfmt
11+
if ! rustup component add rustfmt; then
12+
target=`curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/rustfmt`;
13+
echo "'rustfmt' is unavailable on the toolchain 'nightly', use the toolchain 'nightly-$target' instead";
14+
rustup toolchain install nightly-$target;
15+
rustup default nightly-$target;
16+
rustup component add rustfmt;
17+
fi
1218
displayName: Install rustfmt
1319
- script: |
1420
cargo fmt --all -- --check --unstable-features

0 commit comments

Comments
 (0)