wci-bash 0.20181204142022.0 → 0.20181204142615.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/include.d/functions.bash +14 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29f61fb4bfac2668e39d8375e1851d257ef7aec7
|
4
|
+
data.tar.gz: c9c13ddcc25c1348755ab293ef002bc784a742d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f8ade58ce4296386a745a0c313875b39b7999f40fc75579b6421d8886ace7d03d0445ce7c711098dd6fff8a52cc4b13936649a07333f20e7e4ecb2401f119fb
|
7
|
+
data.tar.gz: fdda264bba2c84bce9bb12bbdb207775151f3833544b535986a9f10671059363347bc4f0938989178521d9f8af88d61ff0f8eb8f37028acec41dbadfbc895454
|
@@ -3,20 +3,21 @@
|
|
3
3
|
|
4
4
|
function log_error {
|
5
5
|
LOG_MESSAGE="$1"
|
6
|
-
|
7
|
-
THIS_PID=${THIS_PID:-THIS_PID NOT SET}
|
6
|
+
set_var_THISPID
|
8
7
|
SCRIPT_NAME=${SCRIPT_NAME:-SCRIPT_NAME NOT SET}
|
9
8
|
LOG_TIMESTAMP=`date "+%F %H:%M:%S %z"`
|
10
9
|
echo "${LOG_TIMESTAMP} - ${THIS_PID} - ${SCRIPT_NAME} - ERROR: ${LOG_MESSAGE}" >&2
|
11
10
|
}
|
12
11
|
|
13
12
|
function log_error_line {
|
14
|
-
|
15
|
-
echo "${
|
13
|
+
LOG_MESSAGE="$1"
|
14
|
+
echo "${LOG_MESSAGE}" >&2
|
16
15
|
}
|
17
16
|
|
18
17
|
function usage {
|
19
|
-
|
18
|
+
if [ ! -z "$1" ] ; then
|
19
|
+
ERROR_MESSAGE="$1"
|
20
|
+
fi
|
20
21
|
ERROR_MESSAGE=${ERROR_MESSAGE:-ERROR_MESSAGE NOT SET}
|
21
22
|
SCRIPT_NAME=${SCRIPT_NAME:-SCRIPT_NAME NOT SET}
|
22
23
|
EXIT_STATUS="1"
|
@@ -42,8 +43,7 @@ function usage {
|
|
42
43
|
function log_event {
|
43
44
|
if [ "${WCI_ENABLE_LOGGING}" == "TRUE" ] ; then
|
44
45
|
LOG_MESSAGE="$1"
|
45
|
-
|
46
|
-
THIS_PID=${THIS_PID:-THIS_PID NOT SET}
|
46
|
+
set_var_THISPID
|
47
47
|
SCRIPT_NAME=${SCRIPT_NAME:-SCRIPT_NAME NOT SET}
|
48
48
|
LOG_TIMESTAMP=`date "+%F %H:%M:%S %z"`
|
49
49
|
echo "${LOG_TIMESTAMP} - ${THIS_PID} - ${SCRIPT_NAME} - ${LOG_MESSAGE}"
|
@@ -64,3 +64,10 @@ function log_pipe {
|
|
64
64
|
fi
|
65
65
|
done < "/dev/stdin"
|
66
66
|
}
|
67
|
+
|
68
|
+
function set_var_THISPID {
|
69
|
+
if [ ! -z "$$" ] ; then
|
70
|
+
THIS_PID="$$"
|
71
|
+
fi
|
72
|
+
THIS_PID=${THIS_PID:-THIS_PID NOT SET}
|
73
|
+
}
|