forked from rust-lang/hashbrown
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.sh
More file actions
45 lines (36 loc) · 874 Bytes
/
Copy pathtools.sh
File metadata and controls
45 lines (36 loc) · 874 Bytes
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
#!/usr/bin/env sh
set -ex
retry() {
result=0
count=1
max=5
while [ "$count" -le 3 ]; do
[ "$result" -ne 0 ] && {
printf "\nRetrying, %d of %d\n" $count $max >&2
}
"$@"
result=$?
[ $result -eq 0 ] && break
count=$(count + 1)
sleep 1
done
[ "$count" -gt 3 ] && {
printf "\nFailed %d times.\n" $max >&2
}
return $result
}
if retry rustup component add rustfmt ; then
cargo fmt --all -- --check
fi
if retry rustup component add clippy ; then
cargo clippy --all -- -D clippy::pedantic
fi
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
if retry rustup component add clippy ; then
cargo clippy --all --target=i586-unknown-linux-gnu -- -D clippy::pedantic
fi
fi
if command -v shellcheck ; then
shellcheck --version
shellcheck ci/*.sh
fi