blob: 3aae73690fe89f536cac19b4bab06a0df605c94f (
plain)
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
|
log_meta() {
# shellcheck disable=SC2059
printf "$1 $2\\n" "${@:3}"
}
log_error() {
log_meta 'error:' "$@" >&2
}
log_fatal() {
log_error "$@"
exit 1
}
log_warning() {
log_meta 'warning:' "$@" >&2
}
log_info() {
log_meta '==>' "$@"
}
map() {
local map_r=0
for _ in "${@:2}"; do
"$1" "$_" || map_r=1
done
return $map_r
}
in_array() {
local item needle=$1
for item in "${@:2}"; do
[[ $item = "$needle" ]] && return 0
done
return 1
}
quiet_git() {
[[ $ASP_GIT_QUIET ]] && set -- "$1" -q "${@:2}"
command git "$@"
}
|