mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-24 07:38:12 -05:00
5
.changeset/cyan-clouds-care.md
Normal file
5
.changeset/cyan-clouds-care.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/config": patch
|
||||
---
|
||||
|
||||
The default home directory for pnpm on macOS should be at `~/Library/pnpm`.
|
||||
@@ -49,7 +49,10 @@ export function getDataDir (
|
||||
if (opts.env.XDG_DATA_HOME) {
|
||||
return path.join(opts.env.XDG_DATA_HOME, 'pnpm')
|
||||
}
|
||||
if (opts.platform !== 'win32' && opts.platform !== 'darwin') {
|
||||
if (opts.platform === 'darwin') {
|
||||
return path.join(os.homedir(), 'Library/pnpm')
|
||||
}
|
||||
if (opts.platform !== 'win32') {
|
||||
return path.join(os.homedir(), '.local/share/pnpm')
|
||||
}
|
||||
if (opts.env.LOCALAPPDATA) {
|
||||
|
||||
@@ -70,7 +70,7 @@ test('getDataDir()', () => {
|
||||
expect(getDataDir({
|
||||
env: {},
|
||||
platform: 'darwin',
|
||||
})).toBe(path.join(os.homedir(), '.pnpm'))
|
||||
})).toBe(path.join(os.homedir(), 'Library/pnpm'))
|
||||
expect(getDataDir({
|
||||
env: {
|
||||
LOCALAPPDATA: '/localappdata',
|
||||
|
||||
Reference in New Issue
Block a user