File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1859,8 +1859,17 @@ async function checkDependencyUpdates(credentialManager) {
18591859 const isBun = process . versions . bun &&
18601860 fs . existsSync ( path . resolve ( process . cwd ( ) , 'bun.lock' ) ) ;
18611861 const isPnpm = fs . existsSync ( path . resolve ( process . cwd ( ) , 'pnpm-lock.yaml' ) ) && ! isBun ;
1862+ const deps = packageJson
1863+ . dependencies || { } ;
18621864 const pkgTargets = updates
1863- . map ( ( u ) => `"${ u . name } @^${ u . latest } "` )
1865+ . map ( ( u ) => {
1866+ if ( u . source === 'GitHub' ) {
1867+ const spec = deps [ u . name ] ;
1868+ if ( spec )
1869+ return `"${ u . name } @${ spec } "` ;
1870+ }
1871+ return `"${ u . name } @^${ u . latest } "` ;
1872+ } )
18641873 . join ( ' ' ) ;
18651874 const cmd = isPnpm
18661875 ? `pnpm add ${ pkgTargets } `
Original file line number Diff line number Diff line change @@ -2288,8 +2288,17 @@ async function checkDependencyUpdates(
22882288 fs . existsSync ( path . resolve ( process . cwd ( ) , 'bun.lock' ) )
22892289 const isPnpm =
22902290 fs . existsSync ( path . resolve ( process . cwd ( ) , 'pnpm-lock.yaml' ) ) && ! isBun
2291+ const deps =
2292+ ( packageJson as { dependencies ?: Record < string , string > } )
2293+ . dependencies || { }
22912294 const pkgTargets = updates
2292- . map ( ( u ) => `"${ u . name } @^${ u . latest } "` )
2295+ . map ( ( u ) => {
2296+ if ( u . source === 'GitHub' ) {
2297+ const spec = deps [ u . name ]
2298+ if ( spec ) return `"${ u . name } @${ spec } "`
2299+ }
2300+ return `"${ u . name } @^${ u . latest } "`
2301+ } )
22932302 . join ( ' ' )
22942303 const cmd = isPnpm
22952304 ? `pnpm add ${ pkgTargets } `
You can’t perform that action at this time.
0 commit comments