mirror of
https://github.com/pnpm/pnpm.git
synced 2026-01-09 15:38:39 -05:00
fix(dlx): don't fail when executed in a dir with no write access (#3668)
This commit is contained in:
5
.changeset/wicked-penguins-attend.md
Normal file
5
.changeset/wicked-penguins-attend.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-script-runners": patch
|
||||
---
|
||||
|
||||
`pnpm dlx` should not fail when pnpm has no write access to the CWD.
|
||||
@@ -1,6 +1,6 @@
|
||||
import fs from 'fs'
|
||||
import os from 'os'
|
||||
import path from 'path'
|
||||
import storePath from '@pnpm/store-path'
|
||||
import rimraf from '@zkochan/rimraf'
|
||||
import execa from 'execa'
|
||||
import PATH from 'path-name'
|
||||
@@ -41,8 +41,7 @@ export async function handler (
|
||||
},
|
||||
params: string[]
|
||||
) {
|
||||
const cache = path.join(await storePath(process.cwd(), '~/.pnpm-store'), 'tmp')
|
||||
const prefix = path.join(cache, `dlx-${process.pid.toString()}`)
|
||||
const prefix = path.join(os.tmpdir(), `dlx-${process.pid.toString()}`)
|
||||
const bins = process.platform === 'win32'
|
||||
? prefix
|
||||
: path.join(prefix, 'bin')
|
||||
|
||||
Reference in New Issue
Block a user