File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 55 "description" : " Open any workspace with a single click." ,
66 "repository" : " https://github.com/coder/vscode-coder" ,
77 "preview" : true ,
8- "version" : " 0.1.5 " ,
8+ "version" : " 0.1.6 " ,
99 "engines" : {
1010 "vscode" : " ^1.73.0"
1111 },
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export class SSHConfig {
6565
6666 private async cleanUpOldConfig ( ) {
6767 const raw = this . getRaw ( )
68- const oldConfig = raw . split ( "\n\n" ) . find ( ( config ) => config . includes ( "Host coder- -vscode--*" ) )
68+ const oldConfig = raw . split ( "\n\n" ) . find ( ( config ) => config . startsWith ( "Host coder-vscode--*" ) )
6969 if ( oldConfig ) {
7070 this . raw = raw . replace ( oldConfig , "" )
7171 }
Original file line number Diff line number Diff line change @@ -104,7 +104,10 @@ export class Storage {
104104 }
105105 }
106106 }
107- const etag = await this . getBinaryETag ( )
107+ let etag = ""
108+ if ( exists ) {
109+ etag = await this . getBinaryETag ( )
110+ }
108111 this . output . appendLine ( `Using binName: ${ binName } ` )
109112 this . output . appendLine ( `Using binPath: ${ binPath } ` )
110113 this . output . appendLine ( `Using ETag: ${ etag } ` )
@@ -189,14 +192,17 @@ export class Storage {
189192 return
190193 }
191194 this . output . appendLine ( `Downloaded binary: ${ binPath } ` )
192- const oldBinPath = binPath + ".old-" + Math . random ( ) . toString ( 36 ) . substring ( 8 )
193- await fs . rename ( binPath , oldBinPath ) . catch ( ( ) => {
194- this . output . appendLine ( `Warning: failed to rename ${ binPath } to ${ oldBinPath } ` )
195- } )
195+ if ( exists ) {
196+ const oldBinPath = binPath + ".old-" + Math . random ( ) . toString ( 36 ) . substring ( 8 )
197+ await fs . rename ( binPath , oldBinPath ) . catch ( ( ) => {
198+ this . output . appendLine ( `Warning: failed to rename ${ binPath } to ${ oldBinPath } ` )
199+ } )
200+ await fs . rm ( oldBinPath , { force : true } ) . catch ( ( error ) => {
201+ this . output . appendLine ( `Warning: failed to remove old binary: ${ error } ` )
202+ } )
203+ }
196204 await fs . rename ( tempFile , binPath )
197- await fs . rm ( oldBinPath , { force : true } ) . catch ( ( error ) => {
198- this . output . appendLine ( `Warning: failed to remove old binary: ${ error } ` )
199- } )
205+
200206 return binPath
201207 }
202208 case 304 : {
You can’t perform that action at this time.
0 commit comments