fix(dlx): don't fail when executed in a dir with no write access (#3668)
This commit is contained in:
1 parent
a4fed27983
commit
b17096a36f
2 files changed
+7
-3
No files matched your search
@@ -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