mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-30 04:52:04 -04:00
fix: use workspace for store use it is enabled (#3979)
close #3976 Co-authored-by: yuhuaheng <yuhuaheng@bytedance.com> Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
6
.changeset/early-toys-think.md
Normal file
6
.changeset/early-toys-think.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/store-connection-manager": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
When the store location is a relative location, pick the store location relative to the workspace root directory location [#3976](https://github.com/pnpm/pnpm/issues/3976).
|
||||
@@ -19,6 +19,7 @@ export type CreateStoreControllerOptions = Omit<CreateNewStoreControllerOptions,
|
||||
| 'dir'
|
||||
| 'useRunningStoreServer'
|
||||
| 'useStoreServer'
|
||||
| 'workspaceDir'
|
||||
>
|
||||
|
||||
export async function createOrConnectStoreControllerCached (
|
||||
@@ -38,7 +39,7 @@ export async function createOrConnectStoreController (
|
||||
ctrl: StoreController
|
||||
dir: string
|
||||
}> {
|
||||
const storeDir = await storePath(opts.dir, opts.storeDir)
|
||||
const storeDir = await storePath(opts.workspaceDir ?? opts.dir, opts.storeDir)
|
||||
const connectionInfoDir = serverConnectionInfoDir(storeDir)
|
||||
const serverJsonPath = path.join(connectionInfoDir, 'server.json')
|
||||
let serverJson = await tryLoadServerJson({ serverJsonPath, shouldRetryOnNoent: false })
|
||||
|
||||
Reference in New Issue
Block a user