Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add --no-save for pnpm upgrade #158

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/commands/check/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable no-console */
import type { SingleBar } from 'cli-progress'
import type { Agent } from 'package-manager-detector'
import type {
CheckOptions,
PackageMeta,
} from '../../types'
/* eslint-disable no-console */
import { detect, parseNi, parseNu, run } from '@antfu/ni'
import c from 'picocolors'
import prompts from 'prompts'
Expand Down Expand Up @@ -123,8 +124,9 @@ export async function check(options: CheckOptions) {
console.log()
}
else if (hasChanges) {
let packageManager: Agent | undefined
if (!options.install && !options.update && !options.interactive) {
const packageManager = await detect()
packageManager = await detect()
console.log(
c.yellow(`ℹ changes written to package.json, run ${c.cyan(`${packageManager} i`)} to install updates.`),
)
Expand Down Expand Up @@ -152,10 +154,14 @@ export async function check(options: CheckOptions) {
}

if (options.update) {
packageManager ||= await detect()
console.log(c.magenta('updating...'))
console.log()

await run(parseNu, options.recursive ? ['-r'] : [])
await run(parseNu, [
options.recursive && '-r',
packageManager === 'pnpm' && '--no-save',
].filter(Boolean) as string[])
}
}

Expand Down