forked from edwingeng/wuid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.sh
38 lines (31 loc) · 821 Bytes
/
check.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
#!/usr/bin/env bash
[[ "$TRACE" ]] && set -x
pushd `dirname "$0"` > /dev/null
trap __EXIT EXIT
colorful=false
tput setaf 7 > /dev/null 2>&1
if [[ $? -eq 0 ]]; then
colorful=true
fi
function __EXIT() {
popd > /dev/null
}
function printError() {
$colorful && tput setaf 1
>&2 echo "Error: $@"
$colorful && tput setaf 7
}
function printImportantMessage() {
$colorful && tput setaf 3
>&2 echo "$@"
$colorful && tput setaf 7
}
function printUsage() {
$colorful && tput setaf 3
>&2 echo "$@"
$colorful && tput setaf 7
}
find . -name coverage.sh | xargs -n 1 bash -c \
'cmp --silent internal/coverage.sh "$0" || echo "files are different. file: $0"'
find . -name vet.sh | xargs -n 1 bash -c \
'cmp --silent internal/vet.sh "$0" || echo "files are different. file: $0"'