mirror of
https://github.com/stablyai/orca.git
synced 2026-10-22 16:03:47 +00:00
17 lines
422 B
JavaScript
17 lines
422 B
JavaScript
export function resolvePnpmCliSpawn(
|
|
args,
|
|
{
|
|
platform = process.platform,
|
|
nodePath = process.execPath,
|
|
npmExecPath = process.env.npm_execpath
|
|
} = {}
|
|
) {
|
|
if (platform !== 'win32') {
|
|
return { command: 'pnpm', args }
|
|
}
|
|
if (!npmExecPath) {
|
|
throw new Error('Run this command through pnpm so its Windows CLI path is available.')
|
|
}
|
|
return { command: nodePath, args: [npmExecPath, ...args] }
|
|
}
|