@percy/cli-exec 1.27.6-beta.1 → 1.27.7-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.
Files changed (2) hide show
  1. package/dist/exec.js +9 -1
  2. package/package.json +3 -3
package/dist/exec.js CHANGED
@@ -107,6 +107,7 @@ async function* spawn(cmd, args, percy) {
107
107
  default: crossSpawn
108
108
  } = await import('cross-spawn');
109
109
  let proc, closed, error;
110
+ let errorMessage = '';
110
111
  try {
111
112
  proc = crossSpawn(cmd, args, {
112
113
  stdio: 'pipe'
@@ -117,8 +118,11 @@ async function* spawn(cmd, args, percy) {
117
118
  process.stdout.write(`${data}`);
118
119
  });
119
120
  }
121
+ // Piping proc sdtin to process
122
+ process.stdin.pipe(proc.stdin);
120
123
  if (proc.stderr) {
121
124
  proc.stderr.on('data', data => {
125
+ errorMessage += data.toString();
122
126
  process.stderr.write(`${data}`);
123
127
  });
124
128
  }
@@ -126,13 +130,17 @@ async function* spawn(cmd, args, percy) {
126
130
  proc.on('close', code => {
127
131
  closed = code;
128
132
  if (code !== 0) {
133
+ // Only send cli error when PERCY_CLIENT_ERROR_LOGS is set to true
134
+ if (process.env.PERCY_CLIENT_ERROR_LOGS === 'false') {
135
+ errorMessage = 'Log sharing is disabled';
136
+ }
129
137
  // Only send event when there is a global error code and
130
138
  // percy token is present
131
139
  if (process.env.PERCY_TOKEN) {
132
140
  const myObject = {
133
141
  errorKind: 'cli',
134
142
  cliVersion: pkg.version,
135
- message: '1'
143
+ message: errorMessage
136
144
  };
137
145
  percy.client.sendBuildEvents(percy.build.id, myObject);
138
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/cli-exec",
3
- "version": "1.27.6-beta.1",
3
+ "version": "1.27.7-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.27.6-beta.1",
36
+ "@percy/cli-command": "1.27.7-beta.0",
37
37
  "cross-spawn": "^7.0.3",
38
38
  "which": "^2.0.2"
39
39
  },
40
- "gitHead": "1a3bf9e775769215ef590faa40502ce0ee0a6f78"
40
+ "gitHead": "80549bd9b92b9868c4576ee100f48bcf58320e84"
41
41
  }