@abtnode/util 1.16.7 → 1.16.8-beta-ca58a421
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/run-script.js +13 -1
- package/lib/url-evaluation/index.js +1 -0
- package/package.json +5 -5
package/lib/run-script.js
CHANGED
|
@@ -5,6 +5,17 @@ const which = require('which');
|
|
|
5
5
|
const stream = require('stream');
|
|
6
6
|
const spawn = require('cross-spawn');
|
|
7
7
|
|
|
8
|
+
const getDate = () => {
|
|
9
|
+
const date = new Date();
|
|
10
|
+
const year = date.getFullYear();
|
|
11
|
+
const month = `0${date.getMonth() + 1}`.slice(-2);
|
|
12
|
+
const day = `0${date.getDate()}`.slice(-2);
|
|
13
|
+
const hours = `0${date.getHours()}`.slice(-2);
|
|
14
|
+
const minutes = `0${date.getMinutes()}`.slice(-2);
|
|
15
|
+
const seconds = `0${date.getSeconds()}`.slice(-2);
|
|
16
|
+
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
17
|
+
};
|
|
18
|
+
|
|
8
19
|
class PrefixTransform extends stream.Transform {
|
|
9
20
|
constructor(prefix, state) {
|
|
10
21
|
super();
|
|
@@ -15,7 +26,8 @@ class PrefixTransform extends stream.Transform {
|
|
|
15
26
|
|
|
16
27
|
// transform all output from child process with a prefix for better readability
|
|
17
28
|
_transform(chunk, _encoding, callback) {
|
|
18
|
-
const { prefix, state } = this;
|
|
29
|
+
const { prefix: rawPrefix, state } = this;
|
|
30
|
+
const prefix = `[${getDate()}] ${rawPrefix}`;
|
|
19
31
|
const nPrefix = `\n${prefix}`;
|
|
20
32
|
const firstPrefix = state.lastIsLineBreak ? prefix : state.lastPrefix !== prefix ? '\n' : '';
|
|
21
33
|
const prefixed = `${firstPrefix}${chunk}`.replace(/\n/g, nPrefix);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.
|
|
6
|
+
"version": "1.16.8-beta-ca58a421",
|
|
7
7
|
"description": "ArcBlock's JavaScript utility",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@abtnode/constant": "1.16.
|
|
22
|
-
"@abtnode/logger": "1.16.
|
|
23
|
-
"@blocklet/constant": "1.16.
|
|
21
|
+
"@abtnode/constant": "1.16.8-beta-ca58a421",
|
|
22
|
+
"@abtnode/logger": "1.16.8-beta-ca58a421",
|
|
23
|
+
"@blocklet/constant": "1.16.8-beta-ca58a421",
|
|
24
24
|
"@ocap/client": "1.18.78",
|
|
25
25
|
"@ocap/mcrypto": "1.18.78",
|
|
26
26
|
"@ocap/util": "1.18.78",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"jest": "^27.5.1",
|
|
72
72
|
"unzipper": "^0.10.11"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "d0f724c8082572a01b6e9287df6c3d0663ec9c57"
|
|
75
75
|
}
|