Skip to content

Commit

Permalink
chore: detect package manager to show in message after writing (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralacerda authored Jan 18, 2025
1 parent db5a0d6 commit ef7778a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/check/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
PackageMeta,
} from '../../types'
/* eslint-disable no-console */
import { parseNi, parseNu, run } from '@antfu/ni'
import { parseNi, parseNu, run, detect } from '@antfu/ni'

Check failure on line 7 in src/commands/check/index.ts

View workflow job for this annotation

GitHub Actions / lint

Expected "detect" to come before "run"
import c from 'picocolors'
import prompts from 'prompts'
import { builtinAddons } from '../../addons'
Expand Down Expand Up @@ -124,8 +124,9 @@ export async function check(options: CheckOptions) {
}
else if (hasChanges) {
if (!options.install && !options.update && !options.interactive) {
const packageManager = await detect()
console.log(
c.yellow(`ℹ changes written to package.json, run ${c.cyan('npm i')} to install updates.`),
c.yellow(`ℹ changes written to package.json, run ${c.cyan(`${packageManager} i`)} to install updates.`),
)
}

Expand Down

0 comments on commit ef7778a

Please sign in to comment.