Skip to content

Commit 1f8e124

Browse files
committedFeb 11, 2025··
fix(global): skip install when no changes
fix 9ba7eb0 again
1 parent 22c80e5 commit 1f8e124

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎src/commands/check/checkGlobal.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ export async function checkGlobal(options: CheckOptions) {
5757
if (options.interactive)
5858
resolvePkgs = await promptInteractive(resolvePkgs, options) as GlobalPackageMeta[]
5959

60-
if (!resolvePkgs.length) {
61-
return exitCode
62-
}
63-
6460
const { lines, errLines } = renderPackages(resolvePkgs, options)
6561

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.