FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
netdata/.github/scripts/functions.sh at master · danmichaelo/netdata · GitHub
danmichaelo
/
netdata
Public
forked from
netdata/netdata
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
netdata
/
.github
/
scripts
/
functions.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
69 lines (56 loc) · 912 Bytes
Breadcrumbs
netdata
/
.github
/
scripts
/
functions.sh
Copy path
File metadata and controls
69 lines (56 loc) · 912 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
60
61
62
63
64
65
66
67
68
69
#!
/bin/sh
#
This file is included by download.sh & build.sh
set
-e
color
() {
fg=
"
$1
"
bg=
"
${2}
"
ft=
"
${3
:-
0}
"
printf
"
\33[%s;%s;%s
"
"
$ft
"
"
$fg
"
"
$bg
"
}
color_reset
() {
printf
"
\033[0m
"
}
ok
() {
if
[
-t
1 ]
;
then
printf
"
%s[ OK ]%s\n
"
"
$(
color 37 42m 1
)
"
"
$(
color_reset
)
"
else
printf
"
%s\n
"
"
[ OK ]
"
fi
}
err
() {
if
[
-t
1 ]
;
then
printf
"
%s[ ERR ]%s\n
"
"
$(
color 37 41m 1
)
"
"
$(
color_reset
)
"
else
printf
"
%s\n
"
"
[ ERR ]
"
fi
}
run
() {
retval=0
logfile=
"
$(
mktemp -t
"
run-XXXXXX
"
)
"
if
"
$@
"
2>
"
$logfile
"
;
then
ok
else
retval=
$?
err
tail -n 100
"
$logfile
"
||
true
fi
rm -rf
"
$logfile
"
return
$retval
}
progress
() {
printf
"
%-40s
"
"
$(
printf
"
%s ...
"
"
$1
"
)
"
}
log
() {
printf
"
%s\n
"
"
$1
"
}
error
() {
log
"
ERROR:
${1}
"
}
fail
() {
log
"
FATAL:
${1}
"
exit
1
}
debug
() {
log
"
Dropping into a shell for debugging ...
"
exec
/bin/sh
}
Back
|
FazBrowse Home
|
New Git URL