mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-23 23:29:17 -05:00
5
.changeset/brown-poems-prove.md
Normal file
5
.changeset/brown-poems-prove.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/config": patch
|
||||
---
|
||||
|
||||
During global install, changes should always be saved to the global package.json, even when save is set to false.
|
||||
@@ -224,6 +224,7 @@ export default async (
|
||||
: pnpmConfig['sharedWorkspaceLockfile']
|
||||
|
||||
if (cliOptions['global']) {
|
||||
pnpmConfig.save = true
|
||||
pnpmConfig.dir = path.join(pnpmConfig.globalDir, LAYOUT_VERSION.toString())
|
||||
pnpmConfig.bin = cliOptions['dir']
|
||||
? (
|
||||
|
||||
@@ -51,6 +51,21 @@ test('throw error if --link-workspace-packages is used with --global', async (t)
|
||||
}
|
||||
})
|
||||
|
||||
test('"save" should always be true during global installation', async (t) => {
|
||||
const { config } = await getConfig({
|
||||
cliOptions: {
|
||||
global: true,
|
||||
save: false,
|
||||
},
|
||||
packageManager: {
|
||||
name: 'pnpm',
|
||||
version: '1.0.0',
|
||||
},
|
||||
})
|
||||
t.ok(config.save)
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('throw error if --shared-workspace-lockfile is used with --global', async (t) => {
|
||||
try {
|
||||
await getConfig({
|
||||
|
||||
Reference in New Issue
Block a user