@percy/cli-exec 1.28.3-beta.1 → 1.28.4-beta.0
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/dist/exec.js +8 -20
- package/dist/start.js +1 -0
- package/package.json +3 -3
package/dist/exec.js
CHANGED
|
@@ -2,9 +2,7 @@ import command from '@percy/cli-command';
|
|
|
2
2
|
import start from './start.js';
|
|
3
3
|
import stop from './stop.js';
|
|
4
4
|
import ping from './ping.js';
|
|
5
|
-
import { getPackageJSON } from '@percy/cli-command/utils';
|
|
6
5
|
import { waitForTimeout } from '@percy/client/utils';
|
|
7
|
-
const pkg = getPackageJSON(import.meta.url);
|
|
8
6
|
export const exec = command('exec', {
|
|
9
7
|
description: 'Start and stop Percy around a supplied command',
|
|
10
8
|
usage: '[options] -- <command>',
|
|
@@ -112,7 +110,6 @@ async function* spawn(cmd, args, percy) {
|
|
|
112
110
|
default: crossSpawn
|
|
113
111
|
} = await import('cross-spawn');
|
|
114
112
|
let proc, closed, error;
|
|
115
|
-
let errorMessage = '';
|
|
116
113
|
try {
|
|
117
114
|
proc = crossSpawn(cmd, args, {
|
|
118
115
|
stdio: 'pipe'
|
|
@@ -127,29 +124,20 @@ async function* spawn(cmd, args, percy) {
|
|
|
127
124
|
process.stdin.pipe(proc.stdin);
|
|
128
125
|
if (proc.stderr) {
|
|
129
126
|
proc.stderr.on('data', data => {
|
|
130
|
-
|
|
127
|
+
var _percy$log;
|
|
128
|
+
const message = data.toString();
|
|
129
|
+
let entry = {
|
|
130
|
+
message,
|
|
131
|
+
timestamp: Date.now(),
|
|
132
|
+
type: 'ci'
|
|
133
|
+
};
|
|
134
|
+
percy === null || percy === void 0 ? void 0 : (_percy$log = percy.log) === null || _percy$log === void 0 ? void 0 : _percy$log.error(entry, null, true);
|
|
131
135
|
process.stderr.write(`${data}`);
|
|
132
136
|
});
|
|
133
137
|
}
|
|
134
138
|
proc.on('error', err => error = err);
|
|
135
139
|
proc.on('close', code => {
|
|
136
140
|
closed = code;
|
|
137
|
-
if (code !== 0) {
|
|
138
|
-
// Only send cli error when PERCY_CLIENT_ERROR_LOGS is set to true
|
|
139
|
-
if (process.env.PERCY_CLIENT_ERROR_LOGS === 'false') {
|
|
140
|
-
errorMessage = 'Log sharing is disabled';
|
|
141
|
-
}
|
|
142
|
-
// Only send event when there is a global error code and
|
|
143
|
-
// percy token is present
|
|
144
|
-
if (process.env.PERCY_TOKEN) {
|
|
145
|
-
const myObject = {
|
|
146
|
-
errorKind: 'cli',
|
|
147
|
-
cliVersion: pkg.version,
|
|
148
|
-
message: errorMessage
|
|
149
|
-
};
|
|
150
|
-
percy.client.sendBuildEvents(percy.build.id, myObject);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
141
|
});
|
|
154
142
|
|
|
155
143
|
// run until an event is triggered
|
package/dist/start.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/cli-exec",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.4-beta.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@percy/cli-command": "1.28.
|
|
36
|
+
"@percy/cli-command": "1.28.4-beta.0",
|
|
37
37
|
"cross-spawn": "^7.0.3",
|
|
38
38
|
"which": "^2.0.2"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "fe4d7e944acd2081d901eb2eed202ccb64098576"
|
|
41
41
|
}
|