create-guilded-bot/packages/cli/lib/getPackageManager.ts

11 lines
222 B
TypeScript
Raw Normal View History

2022-11-22 09:43:25 +00:00
export default function get(): string | null {
const userAgent = process.env.npm_config_user_agent;
if (!userAgent) {
return null;
}
2022-11-22 09:43:25 +00:00
const manager = userAgent.split(" ")[0].split("/")[0];
2022-11-22 09:43:25 +00:00
return manager;
}