Skip to content

Commit

Permalink
chore(cli) track package manager usage (#27491)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamo committed Oct 20, 2020
1 parent 85cd674 commit 1baed44
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/gatsby-cli/src/create-cli.ts
Expand Up @@ -567,6 +567,7 @@ export const createCli = (argv: Array<string>): yargs.Arguments => {

handler: handlerP(({ cmd, key, value }: yargs.Arguments) => {
if (!getPackageManager()) {
trackCli(`SET_DEFAULT_PACKAGE_MANAGER`, { name: `npm` })
setPackageManager(`npm`)
}

Expand All @@ -579,8 +580,10 @@ export const createCli = (argv: Array<string>): yargs.Arguments => {
if (value) {
// @ts-ignore
setPackageManager(value)
trackCli(`SET_PACKAGE_MANAGER`, { name: `${value}` })
return
} else {
trackCli(`SET_PACKAGE_MANAGER`, { name: `npm` })
setPackageManager(`npm`)
}
} else {
Expand Down

0 comments on commit 1baed44

Please sign in to comment.