Skip to content

Commit 5d73776

Browse files
Atul9Stjepan Glavina
authored and
Stjepan Glavina
committed
Use the latest toolchain with rustfmt available if rustfmt is unavailable on the latest nightly (#155)
1 parent 481002e commit 5d73776

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.travis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ matrix:
1818
- name: fmt
1919
rust: nightly
2020
os: linux
21-
before_script:
22-
- rustup component add rustfmt
21+
before_script: |
22+
if ! rustup component add rustfmt; then
23+
target=`curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/rustfmt`;
24+
echo "'rustfmt' is unavailable on the toolchain 'nightly', use the toolchain 'nightly-$target' instead";
25+
rustup toolchain install nightly-$target;
26+
rustup default nightly-$target;
27+
rustup component add rustfmt;
28+
fi
2329
script:
2430
- cargo fmt --all -- --check
2531

0 commit comments

Comments
 (0)