From 6e33173fce77d2d1f262f6f1e25a92e6b44a8bd5 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Wed, 25 Jan 2017 15:42:16 -0800 Subject: [PATCH] Install rustfmt when running under Travis CI. The built rustfmt should be cached. --- test-all.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test-all.sh b/test-all.sh index 8035703488..aebec1a872 100755 --- a/test-all.sh +++ b/test-all.sh @@ -35,6 +35,12 @@ RUSTFMT_VERSION="0.7.1" if cargo install --list | grep -q "^rustfmt v$RUSTFMT_VERSION"; then banner "Rust formatting" $topdir/format-all.sh --write-mode=diff +elif [ -n "$TRAVIS" ]; then + # We're running under Travis CI. + # Install rustfmt, it will be cached for the next build. + echo "Installing rustfmt v$RUSTFMT_VERSION." + cargo install --force --vers="$RUSTFMT_VERSION" rustfmt + $topdir/format-all.sh --write-mode=diff else echo "Please install rustfmt v$RUSTFMT_VERSION to verify formatting." echo "If a newer version of rustfmt is available, update this script."