24 lines
531 B
JavaScript
Executable File
24 lines
531 B
JavaScript
Executable File
import { spawnSync } from 'node:child_process';
|
|
|
|
const args = process.argv.slice(2);
|
|
const npmExecPath = process.env.npm_execpath;
|
|
|
|
const command = npmExecPath && npmExecPath.includes('pnpm')
|
|
? process.execPath
|
|
: 'pnpm';
|
|
const commandArgs = npmExecPath && npmExecPath.includes('pnpm')
|
|
? [npmExecPath, ...args]
|
|
: args;
|
|
|
|
const result = spawnSync(command, commandArgs, {
|
|
stdio: 'inherit',
|
|
shell: false
|
|
});
|
|
|
|
if (result.error) {
|
|
console.error(result.error.message);
|
|
process.exit(1);
|
|
}
|
|
|
|
process.exit(result.status ?? 1);
|