Skip to content

Commit

Permalink
fix(global): skip install when no changes
Browse files Browse the repository at this point in the history
fix 9ba7eb0 again
  • Loading branch information
sxzz committed Feb 11, 2025
1 parent 22c80e5 commit 1f8e124
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/commands/check/checkGlobal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ export async function checkGlobal(options: CheckOptions) {
if (options.interactive)
resolvePkgs = await promptInteractive(resolvePkgs, options) as GlobalPackageMeta[]

if (!resolvePkgs.length) {
return exitCode
}

const { lines, errLines } = renderPackages(resolvePkgs, options)

const hasChanges = resolvePkgs.length && resolvePkgs.some(i => i.resolved.some(j => j.update))
Expand Down Expand Up @@ -185,6 +181,8 @@ async function loadGlobalNpmPackage(options: CheckOptions): Promise<GlobalPackag

async function installPkg(pkg: GlobalPackageMeta) {
const changes = pkg.resolved.filter(i => i.update)
if (!changes.length)
return
const dependencies = dumpDependencies(changes, 'dependencies')
const updateArgs = Object.entries(dependencies).map(([name, version]) => `${name}@${version}`)
const install = getCommand(pkg.agent, 'global', [...updateArgs])
Expand Down

0 comments on commit 1f8e124

Please sign in to comment.