@@ -197,7 +197,14 @@ export async function pnpmFix(
197197 const sortedInfoEntries = [ ...infoByPkgName . entries ( ) ] . sort ( ( a , b ) =>
198198 naturalCompare ( a [ 0 ] , b [ 0 ] )
199199 )
200- infoEntriesLoop: for ( const { 0 : name , 1 : infos } of sortedInfoEntries ) {
200+ infoEntriesLoop: for (
201+ let i = 0 , { length } = sortedInfoEntries ;
202+ i < length ;
203+ i += 1
204+ ) {
205+ const { 0 : name , 1 : infos } = sortedInfoEntries [ i ] !
206+ const isLastInfoEntry = i === length - 1
207+
201208 logger . log ( `Processing vulnerable package: ${ name } ` )
202209 logger . indent ( )
203210 spinner ?. indent ( )
@@ -226,6 +233,7 @@ export async function pnpmFix(
226233 : path . relative ( rootPath , pkgPath )
227234
228235 logger . log ( `Checking workspace: ${ workspaceName } ` )
236+ const workspaceLogCallCount = logger . logCallCount
229237
230238 // eslint-disable-next-line no-await-in-loop
231239 actualTree = await install ( pkgEnvDetails , { cwd, spinner } )
@@ -488,13 +496,15 @@ export async function pnpmFix(
488496 }
489497 }
490498 }
491- logger . log ( '' )
499+ if ( logger . logCallCount > workspaceLogCallCount ) {
500+ logger . log ( '' )
501+ }
492502 }
493503
494504 for ( const warningText of warningsForAfter ) {
495505 logger . warn ( warningText )
496506 }
497- if ( warningsForAfter . size ) {
507+ if ( ! isLastInfoEntry ) {
498508 logger . log ( '' )
499509 }
500510
0 commit comments