-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclippy.sh
executable file
·46 lines (39 loc) · 1.07 KB
/
clippy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
mode="$1"
<<<<<<< HEAD
if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
if [ "$mode" = "install" ]; then
# Test if clippy is already installed (cache)
<<<<<<< HEAD
if cargo clippy -V; then
echo "Clippy already installed, skipping installation"
=======
cargo clippy &> /dev/null
if [ $? -ne 101 ]; then
>>>>>>> 97a3db4 (Fix Travis failing on installing Clippy when it's already in cache)
exit 0
fi
=======
if [ "$TRAVIS_RUST_VERSION" != "nightly" ] && [ "$RUSTUP_NIGHTLY" != "yes" ]; then
exit 0
fi
>>>>>>> 2eb2064 (Fixed clippy script)
CARGO="cargo"
if [ "$RUSTUP_NIGHTLY" = "yes" ]; then
CARGO="rustup run nightly cargo"
fi
if [ "$mode" = "install" ]; then
# Test if clippy is already installed (cache)
if $CARGO clippy -V; then
exit 0
fi
# Clippy could be installed, but failed on the version check, added --force for that case
$CARGO install clippy --force --verbose
exit $?
elif [ "$mode" = "test" ]; then
$CARGO clippy --verbose -- -D warnings
exit $?
else
echo "Mode not specified or unknown" >&2
exit 1
fi