kv-clearnup/scripts/check-pnpm.js
2026-02-02 08:33:46 +07:00

13 lines
526 B
JavaScript

import { fileURLToPath } from 'url';
import path from 'path';
const agent = process.env.npm_config_user_agent;
const execPath = process.env.npm_execpath;
// Allow 'bun' based on our bootstrapping, but prefer pnpm.
// Since we are running pnpm via bun, the user agent likely contains pnpm.
if (!agent || !agent.includes('pnpm')) {
console.error('\u001b[31m\nError: You must use pnpm to install dependencies in this project.\n\u001b[0m');
console.error(`Current agent: ${agent || 'unknown'}`);
process.exit(1);
}