mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-24 07:38:12 -05:00
5
.changeset/mighty-keys-type.md
Normal file
5
.changeset/mighty-keys-type.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/lifecycle": minor
|
||||
---
|
||||
|
||||
Don't execute lifecycle scripts that are meant to prevent the usage of npm or Yarn.
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"lint": "tslint --config tslint.json **/src/**/*.ts **/test/**/*.ts --exclude '**/node_modules/**'",
|
||||
"test-master": "pnpm run lint && pnpm run compile && run-p -r verdaccio test-pkgs-master",
|
||||
"test-pkgs-master": "cross-env PNPM_REGISTRY_MOCK_UPLINK=http://localhost:7348 pnpm run _test --no-sort --filter=./packages --filter=./privatePackages",
|
||||
|
||||
@@ -32,6 +32,9 @@ export default async function runLifecycleHook (
|
||||
if (opts.args?.length && m.scripts?.[stage]) {
|
||||
m.scripts[stage] = `${m.scripts[stage]} ${opts.args.map((arg) => `"${arg}"`).join(' ')}`
|
||||
}
|
||||
// This script is used to prevent the usage of npm or Yarn.
|
||||
// It does nothing, when pnpm is used, so we may skip its execution.
|
||||
if (m.scripts[stage] === 'npx only-allow pnpm') return
|
||||
if (opts.stdio !== 'inherit') {
|
||||
lifecycleLogger.debug({
|
||||
depPath: opts.depPath,
|
||||
|
||||
Reference in New Issue
Block a user