Skip to content

Commit

Permalink
fix: normalize cwd on Windows
Browse files Browse the repository at this point in the history
close #6524
  • Loading branch information
zkochan committed May 10, 2023
1 parent 90ab492 commit b92a308
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/tasty-kiwis-change.md
@@ -0,0 +1,6 @@
---
"@pnpm/config": patch
"pnpm": patch
---

Normalize current working directory on Windows [#6524](https://github.com/pnpm/pnpm/issues/6524).
1 change: 1 addition & 0 deletions config/config/package.json
Expand Up @@ -41,6 +41,7 @@
"@pnpm/pnpmfile": "workspace:*",
"@pnpm/read-project-manifest": "workspace:*",
"@pnpm/types": "workspace:*",
"better-path-resolve": "1.0.0",
"camelcase": "^6.3.0",
"camelcase-keys": "^6.2.2",
"can-write-to-dir": "^1.1.1",
Expand Down
3 changes: 2 additions & 1 deletion config/config/src/index.ts
Expand Up @@ -8,6 +8,7 @@ import { requireHooks } from '@pnpm/pnpmfile'
import { safeReadProjectManifestOnly } from '@pnpm/read-project-manifest'
import { getCurrentBranch } from '@pnpm/git-utils'
import { createMatcher } from '@pnpm/matcher'
import betterPathResolve from 'better-path-resolve'
import camelcase from 'camelcase'
import isWindows from 'is-windows'
import normalizeRegistryUrl from 'normalize-registry-url'
Expand Down Expand Up @@ -267,7 +268,7 @@ export async function getConfig (
...rcOptions.map((configKey) => [camelcase(configKey), npmConfig.get(configKey)]) as any, // eslint-disable-line
...Object.entries(cliOptions).filter(([name, value]) => typeof value !== 'undefined').map(([name, value]) => [camelcase(name), value]),
]) as unknown as ConfigWithDeprecatedSettings
const cwd = (cliOptions.dir && path.resolve(cliOptions.dir)) ?? npmConfig.localPrefix
const cwd = betterPathResolve(cliOptions.dir ?? npmConfig.localPrefix)

pnpmConfig.maxSockets = npmConfig.maxsockets
// @ts-expect-error
Expand Down
16 changes: 9 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b92a308

Please sign in to comment.