@pnpm/lifecycle
Advanced tools
Comparing version 7.0.1 to 7.0.2
@@ -11,4 +11,5 @@ "use strict"; | ||
async function runPostinstallHooks(opts) { | ||
var _a, _b; | ||
const pkg = await read_package_json_1.fromDir(opts.pkgRoot); | ||
const scripts = pkg && pkg.scripts || {}; | ||
const scripts = (_b = (_a = pkg) === null || _a === void 0 ? void 0 : _a.scripts, (_b !== null && _b !== void 0 ? _b : {})); | ||
if (!scripts.install) { | ||
@@ -15,0 +16,0 @@ await checkBindingGyp(opts.pkgRoot, scripts); |
@@ -7,2 +7,3 @@ "use strict"; | ||
async function runLifecycleHook(stage, manifest, opts) { | ||
var _a, _b; | ||
const optional = opts.optional === true; | ||
@@ -23,3 +24,3 @@ if (opts.stdio !== 'inherit') { | ||
} | ||
if (opts.args && opts.args.length && m.scripts && m.scripts[stage]) { | ||
if (((_a = opts.args) === null || _a === void 0 ? void 0 : _a.length) && ((_b = m.scripts) === null || _b === void 0 ? void 0 : _b[stage])) { | ||
m.scripts[stage] = `${m.scripts[stage]} ${opts.args.map((arg) => `"${arg}"`).join(' ')}`; | ||
@@ -77,11 +78,3 @@ } | ||
function getId(manifest) { | ||
if (!manifest.name) { | ||
// Using an empty string instead of undefined or null | ||
// because this gets printed to the console | ||
return ''; | ||
} | ||
if (!manifest.version) { | ||
return manifest.name; | ||
} | ||
return `${manifest.name}@${manifest.version}`; | ||
return `${manifest.name || ''}@${manifest.version || ''}`; | ||
} |
{ | ||
"name": "@pnpm/lifecycle", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"description": "Package lifecycle hook runner", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
10919
192