Socket
Socket
Sign inDemoInstall

@percy/cli-exec

Package Overview
Dependencies
Maintainers
6
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/cli-exec - npm Package Compare versions

Comparing version 1.27.5-alpha.0 to 1.27.5-beta.0

35

dist/exec.js

@@ -5,2 +5,4 @@ import command from '@percy/cli-command';

import ping from './ping.js';
import { getPackageJSON } from '@percy/cli-command/utils';
const pkg = getPackageJSON(import.meta.url);
export const exec = command('exec', {

@@ -93,3 +95,3 @@ description: 'Start and stop Percy around a supplied command',

log.info(`Running "${[command, ...args].join(' ')}"`);
let [status, error] = yield* spawn(command, args);
let [status, error] = yield* spawn(command, args, percy);

@@ -105,3 +107,3 @@ // stop percy if running (force stop if there is an error);

// with any error encountered while running. Uses a generator pattern to handle interupt signals.
async function* spawn(cmd, args) {
async function* spawn(cmd, args, percy) {
let {

@@ -113,6 +115,31 @@ default: crossSpawn

proc = crossSpawn(cmd, args, {
stdio: 'inherit'
stdio: 'pipe'
});
proc.on('close', code => closed = code);
// Writing stdout of proc to process
if (proc.stdout) {
proc.stdout.on('data', data => {
process.stdout.write(`${data}`);
});
}
if (proc.stderr) {
proc.stderr.on('data', data => {
process.stderr.write(`${data}`);
});
}
proc.on('error', err => error = err);
proc.on('close', code => {
closed = code;
if (code !== 0) {
// Only send event when there is a global error code and
// percy token is present
if (process.env.PERCY_TOKEN) {
const myObject = {
errorKind: 'cli',
cliVersion: pkg.version,
message: '1'
};
percy.client.sendBuildEvents(percy.build.id, myObject);
}
}
});

@@ -119,0 +146,0 @@ // run until an event is triggered

8

package.json
{
"name": "@percy/cli-exec",
"version": "1.27.5-alpha.0",
"version": "1.27.5-beta.0",
"license": "MIT",

@@ -12,3 +12,3 @@ "repository": {

"access": "public",
"tag": "alpha"
"tag": "latest"
},

@@ -37,7 +37,7 @@ "engines": {

"dependencies": {
"@percy/cli-command": "1.27.5-alpha.0",
"@percy/cli-command": "1.27.5-beta.0",
"cross-spawn": "^7.0.3",
"which": "^2.0.2"
},
"gitHead": "8ecc32db25f708a01192b8454d0fdf9c051f48a0"
"gitHead": "5fed59aa21112e7854a414306504ce7243df7365"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc