@npmcli/run-script
Advanced tools
Comparing version 1.6.0 to 1.7.0
const makeSpawnArgs = require('./make-spawn-args.js') | ||
const promiseSpawn = require('@npmcli/promise-spawn') | ||
const packageEnvs = require('./package-envs.js') | ||
const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp') | ||
@@ -8,3 +9,3 @@ // you wouldn't like me when I'm angry... | ||
const runScriptPkg = options => { | ||
const runScriptPkg = async options => { | ||
const { | ||
@@ -23,7 +24,15 @@ event, | ||
const cmd = options.cmd ? options.cmd | ||
: pkg.scripts && pkg.scripts[event] | ||
? pkg.scripts[event] + | ||
args.map(a => ` ${JSON.stringify(a)}`).join('') | ||
: null | ||
let cmd = null | ||
if (options.cmd) { | ||
cmd = options.cmd | ||
} else if (pkg.scripts && pkg.scripts[event]) { | ||
cmd = pkg.scripts[event] + args.map(a => ` ${JSON.stringify(a)}`).join('') | ||
} else if ( // If there is no preinstall or install script, default to rebuilding node-gyp packages. | ||
event === 'install' && | ||
! pkg.scripts.install && | ||
! pkg.scripts.preinstall && | ||
await isNodeGypPackage(path) | ||
) { | ||
cmd = defaultGypInstallScript | ||
} | ||
@@ -30,0 +39,0 @@ if (!cmd) |
{ | ||
"name": "@npmcli/run-script", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", | ||
@@ -23,2 +23,3 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", | ||
"dependencies": { | ||
"@npmcli/node-gyp": "^1.0.0", | ||
"@npmcli/promise-spawn": "^1.2.0", | ||
@@ -25,0 +26,0 @@ "infer-owner": "^1.0.4", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13965
190
5
+ Added@npmcli/node-gyp@^1.0.0
+ Added@npmcli/node-gyp@1.0.3(transitive)