Files
pnpm/exec/pnpm-cli-runner/src/index.ts
Rayan Salhab 247d70b40c fix: silence verify-deps auto-install output (#11679)
* fix: silence verify-deps auto-install output

* fix: pass reporter to dependency status install

---------

Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com>
2026-05-18 01:57:46 +02:00

25 lines
768 B
TypeScript

import path from 'node:path'
import { sync as execSync } from 'execa'
export interface RunPnpmCliOptions {
cwd: string
reporter?: string
}
export function runPnpmCli (command: string[], { cwd, reporter }: RunPnpmCliOptions): void {
const execOpts = {
cwd,
stdio: 'inherit' as const,
}
const cliCommand = reporter ? [...command, `--reporter=${reporter}`] : command
const execFileName = path.basename(process.execPath).toLowerCase()
if (execFileName === 'pnpm' || execFileName === 'pnpm.exe') {
execSync(process.execPath, cliCommand, execOpts)
} else if (path.basename(process.argv[1]) === 'pnpm.mjs') {
execSync(process.execPath, [process.argv[1], ...cliCommand], execOpts)
} else {
execSync('pnpm', cliCommand, execOpts)
}
}