Skip to content

Commit

Permalink
support cnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyunhe committed Feb 6, 2024
1 parent 35e4ab9 commit fd74c68
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/f2elint/src/private/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import commandExists from 'command-exists';

export async function install(projectPath: string) {
let npm_command = 'npm';
if (await commandExists('tnpm')) {
// tnpm of Alibaba and Ant Group
npm_command = 'tnpm';
} else if (process.env.npm_command) {
if (process.env.npm_command) {
// pnpm, yarn support npm_command environment variable
npm_command = process.env.npm_command;
} else if (await commandExists('tnpm')) {
// tnpm of Alibaba and Ant Group
npm_command = 'tnpm';
} else if (await commandExists('cnpm')) {
// cnpm of China
npm_command = 'cnpm';
}

await new Promise<void>((res, rej) => {
Expand Down

0 comments on commit fd74c68

Please sign in to comment.