Socket
Socket
Sign inDemoInstall

electron-installer-common

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-installer-common - npm Package Compare versions

Comparing version 0.9.0 to 0.10.0

11

NEWS.md

@@ -5,4 +5,13 @@ # `electron-installer-common` - Changes by Version

[Unreleased]: https://github.com/electron-userland/electron-installer-common/compare/v0.9.0...master
[Unreleased]: https://github.com/electron-userland/electron-installer-common/compare/v0.10.0...master
## [0.10.0] - 2020-01-21
[0.10.0]: https://github.com/electron-userland/electron-installer-common/compare/v0.9.0...v0.10.0
### Changed
* The function signature for `spawn` is compatible with the one in `child_process`, with the
addition of `logger` and `updateErrorCallback` (#62)
## [0.9.0] - 2020-01-16

@@ -9,0 +18,0 @@

28

package.json
{
"name": "electron-installer-common",
"version": "0.9.0",
"version": "0.10.0",
"description": "Common functionality for creating distributable Electron apps",

@@ -25,7 +25,7 @@ "author": "Mark Lee",

"devDependencies": {
"ava": "^2.0.0",
"ava": "^3.0.0",
"codecov": "^3.5.0",
"eslint": "^6.0.1",
"eslint-config-standard": "^14.0.0",
"eslint-plugin-ava": "^9.0.0",
"eslint-plugin-ava": "^10.0.0",
"eslint-plugin-import": "^2.14.0",

@@ -52,9 +52,2 @@ "eslint-plugin-node": "^11.0.0",

},
"ava": {
"babel": false,
"compileEnhancements": false,
"files": [
"test/*.js"
]
},
"eslintConfig": {

@@ -69,17 +62,4 @@ "extends": [

"standard"
],
"plugins": [
"ava"
],
"rules": {
"node/no-unpublished-require": [
"error",
{
"allowModules": [
"ava"
]
}
]
}
]
}
}

@@ -6,8 +6,11 @@ 'use strict'

/**
* Spawn a child process and make the error message more human friendly, if possible.
* A wrapper around `cross-spawn`'s `spawn` function which can optionally log the command executed
* and/or change the error message via a callback.
*
* If logger is specified, it's usually a debug or console.log function pointer.
* Specify updateErrorCallback (a callback) to adjust the error object before it is rethrown.
* If logger is specified in options, it's usually a debug or console.log function pointer.
* Specify updateErrorCallback (a callback) in options to adjust the error object before it
* is rethrown.
*/
module.exports = async function (cmd, args, logger, updateErrorCallback) {
module.exports = async function (cmd, args, options = {}) {
const { logger, updateErrorCallback, ...spawnOptions } = options
if (logger) logger(`Executing command ${cmd} ${args.join(' ')}`)

@@ -18,10 +21,14 @@

let stderr = ''
const process = spawn(cmd, args)
process.stdout.on('data', data => {
stdout += data.toString()
})
process.stderr.on('data', data => {
/* istanbul ignore next */
stderr += data.toString()
})
const process = spawn(cmd, args, spawnOptions)
if (process.stdout) {
process.stdout.on('data', data => {
stdout += data.toString()
})
}
if (process.stderr) {
process.stderr.on('data', data => {
/* istanbul ignore next */
stderr += data.toString()
})
}
process.on('close', code => {

@@ -28,0 +35,0 @@ if (code === 0) {

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