forked from BrentDouglas/chainlink
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions
More file actions
executable file
·59 lines (55 loc) · 1.11 KB
/
functions
File metadata and controls
executable file
·59 lines (55 loc) · 1.11 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
#
# @author <a href="mailto:brent.n.douglas@gmail.com">Brent Douglas</a>
#
GREEN="${GREEN-\033[32m}"
YELLOW="${YELLOW-\033[33m}"
RED="${RED-\033[31m}"
RESET="${RESET-\033[00m}"
green() {
echo -e "${GREEN}${@}${RESET}"
}
yellow() {
echo -e "${YELLOW}${@}${RESET}"
}
red() {
echo -e "${RED}${@}${RESET}"
}
ok() {
echo -e "[${GREEN}OK${RESET}] ${@}"
}
aborted() {
echo -e "[${YELLOW}ABORTED${RESET}] ${@}"
}
failed() {
echo -e "[${RED}FAILED${RESET}] ${@}"
}
terminate() {
local ret=${1}
local msg="${2}"
if [ ${ret} -eq 0 ]; then
ok
elif [ ${ret} -eq 130 ]; then
aborted
else
failed
echo -e "${msg}"
fi
exit ${ret}
}
maven() {
[ -z "${MVN-}" ] && {
if [ $(which mvn) ]; then
MVN="mvn"
elif [ ! -z "${M2-}" ]; then
MVN="${M2}/mvn"
elif [ ! -z "${M2_HOME-}" ]; then
MVN="${M2_HOME}/bin/mvn"
else
red "Cannot find file mvn in PATH or find environment variables M2 and M2_HOME"
return 1
fi
}
"${MVN}" "${@}"
return ${?}
}