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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/include.d/functions.bash +14 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a670ab28f40147f37ada7f94c3e9a5f1bacfbf5
4
- data.tar.gz: bbc648032ac924e8e33749accc23390e5f09d310
3
+ metadata.gz: 29f61fb4bfac2668e39d8375e1851d257ef7aec7
4
+ data.tar.gz: c9c13ddcc25c1348755ab293ef002bc784a742d1
5
5
  SHA512:
6
- metadata.gz: 272d87c9c1015190012c67a52afd4544a73aace2cf9d0358ec0a80bb40bc9897f18058d618f98956fe05200bdeac09d90f760753c82abf6dc1a7edfe3b066a2f
7
- data.tar.gz: 47fea8c59834723698ee54f50b4eb70d13657bbee880103213747be05f29f384a5f1402b53c4114390072907e3c002f433b73ebad7408cb529efb1003d12cdb1
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
- THIS_PID="$$"
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
- ERROR_MESSAGE="$1"
15
- echo "${ERROR_MESSAGE}" >&2
13
+ LOG_MESSAGE="$1"
14
+ echo "${LOG_MESSAGE}" >&2
16
15
  }
17
16
 
18
17
  function usage {
19
- ERROR_MESSAGE="$1"
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
- THIS_PID="$$"
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
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wci-bash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20181204142022.0
4
+ version: 0.20181204142615.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WCI