Install rustfmt when running under Travis CI.
The built rustfmt should be cached.
This commit is contained in:
@@ -35,6 +35,12 @@ RUSTFMT_VERSION="0.7.1"
|
|||||||
if cargo install --list | grep -q "^rustfmt v$RUSTFMT_VERSION"; then
|
if cargo install --list | grep -q "^rustfmt v$RUSTFMT_VERSION"; then
|
||||||
banner "Rust formatting"
|
banner "Rust formatting"
|
||||||
$topdir/format-all.sh --write-mode=diff
|
$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
|
else
|
||||||
echo "Please install rustfmt v$RUSTFMT_VERSION to verify formatting."
|
echo "Please install rustfmt v$RUSTFMT_VERSION to verify formatting."
|
||||||
echo "If a newer version of rustfmt is available, update this script."
|
echo "If a newer version of rustfmt is available, update this script."
|
||||||
|
|||||||
Reference in New Issue
Block a user