mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-10 18:18:56 -04:00
fix: ignoreScripts shoud be true when lockfileOnly is true (#3765)
closes: #3750 Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
5
.changeset/kind-dots-exercise.md
Normal file
5
.changeset/kind-dots-exercise.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"supi": patch
|
||||
---
|
||||
|
||||
Scripts should always be ignored when only the lockfile is being updated.
|
||||
@@ -4,5 +4,8 @@
|
||||
"dependencies": {
|
||||
"dep-of-pkg-with-1-dep": "^101.0.0",
|
||||
"pkg-with-1-dep": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"prepare": "exit 1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,9 +167,12 @@ export default async (
|
||||
...opts,
|
||||
storeDir: defaultOpts.storeDir,
|
||||
}
|
||||
if (!extendedOpts.useLockfile && extendedOpts.lockfileOnly) {
|
||||
throw new PnpmError('CONFIG_CONFLICT_LOCKFILE_ONLY_WITH_NO_LOCKFILE',
|
||||
`Cannot generate a ${WANTED_LOCKFILE} because lockfile is set to false`)
|
||||
if (extendedOpts.lockfileOnly) {
|
||||
extendedOpts.ignoreScripts = true
|
||||
if (!extendedOpts.useLockfile) {
|
||||
throw new PnpmError('CONFIG_CONFLICT_LOCKFILE_ONLY_WITH_NO_LOCKFILE',
|
||||
`Cannot generate a ${WANTED_LOCKFILE} because lockfile is set to false`)
|
||||
}
|
||||
}
|
||||
if (extendedOpts.userAgent.startsWith('npm/')) {
|
||||
extendedOpts.userAgent = `${extendedOpts.packageManager.name}/${extendedOpts.packageManager.version} ${extendedOpts.userAgent}`
|
||||
|
||||
Reference in New Issue
Block a user