File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export const upgradeCommand = new Command('upgrade')
5353 } else if ( options . channel ) {
5454 await writeConfig ( { updateChannel : channel } ) ;
5555 }
56- const targetVersion = options . version || options . pin || ( ! options . unpin ? config . pinnedVersion : undefined ) ;
56+ const targetVersion = options . version || options . pin || ( options . unpin ? undefined : config . pinnedVersion ) ;
5757
5858 if ( ! options . json ) {
5959 const suffix = targetVersion ? ` (target: ${ targetVersion } )` : '' ;
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ export interface ReleaseInfo {
2323 browser_download_url : string ;
2424 } > ;
2525 body : string ;
26+ prerelease : boolean ;
27+ draft : boolean ;
2628}
2729
2830export interface UpdateStatus {
@@ -113,7 +115,7 @@ export async function getLatestPrerelease(): Promise<ReleaseInfo> {
113115 try {
114116 const response = await githubGet < ReleaseInfo [ ] > ( GITHUB_RELEASES_URL ) ;
115117 const releases = Array . isArray ( response . data ) ? response . data : [ ] ;
116- const prerelease = releases . find ( ( r : { prerelease ?: boolean ; draft ?: boolean } ) => r . prerelease && ! r . draft ) ;
118+ const prerelease = releases . find ( r => r . prerelease && ! r . draft ) ;
117119 if ( ! prerelease ) {
118120 throw new Error ( 'No prerelease found' ) ;
119121 }
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ describe('Self Update Module', () => {
3333 { name : 'cloudsqlctl-setup.exe' , browser_download_url : 'http://example.com/setup' } ,
3434 { name : 'SHA256SUMS.txt' , browser_download_url : 'http://example.com/sums' }
3535 ] ,
36- body : 'Release notes'
36+ body : 'Release notes' ,
37+ prerelease : false ,
38+ draft : false
3739 } ;
3840
3941 beforeEach ( ( ) => {
You can’t perform that action at this time.
0 commit comments