File tree Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 1676
1676
"@types/chai" : " ^4.3.19" ,
1677
1677
"@types/chai-as-promised" : " ^7.1.8" ,
1678
1678
"@types/chai-subset" : " ^1.3.6" ,
1679
+ "@types/decompress" : " ^4.2.7" ,
1679
1680
"@types/glob" : " ^7.1.6" ,
1680
1681
"@types/lcov-parse" : " ^1.0.2" ,
1681
1682
"@types/lodash.debounce" : " ^4.0.9" ,
Original file line number Diff line number Diff line change @@ -57,11 +57,21 @@ const repo = repository.split("/")[1];
57
57
const files = await decompress ( "artifacts.zip" , process . cwd ( ) ) ;
58
58
console . log ( `Downloaded artifact(s): ${ files . map ( f => f . path ) . join ( ", " ) } ` ) ;
59
59
const newName = process . env [ "VSCODE_SWIFT_VSIX" ] || "vscode-swift.vsix" ;
60
- await rename ( files [ 0 ] . path , newName ) ;
61
- console . log ( `Renamed artifact: ${ files [ 0 ] . path } => ${ newName } ` ) ;
60
+ const releaseVSIX = files . find ( f => / s w i f t - v s c o d e - \d .\d .\d - \d + .v s i x / m. test ( f . path ) ) ;
61
+ if ( ! releaseVSIX ) {
62
+ console . error ( "Cound not find vscode-swift release VSIX in artifact bundle" ) ;
63
+ process . exit ( 1 ) ;
64
+ }
65
+ await rename ( releaseVSIX . path , newName ) ;
66
+ const prereleaseVSIX = files . find ( f => / s w i f t - v s c o d e - \d .\d .\d { 8 } - \d + .v s i x / m. test ( f . path ) ) ;
67
+ if ( ! prereleaseVSIX ) {
68
+ console . error ( "Cound not find vscode-swift pre-release VSIX in artifact bundle" ) ;
69
+ process . exit ( 1 ) ;
70
+ }
71
+ console . log ( `Renamed artifact: ${ releaseVSIX . path } => ${ newName } ` ) ;
62
72
const preNewName =
63
73
process . env [ "VSCODE_SWIFT_PRERELEASE_VSIX" ] || "vscode-swift-prerelease.vsix" ;
64
- await rename ( files [ 1 ] . path , preNewName ) ;
65
- console . log ( `Renamed artifact: ${ files [ 1 ] . path } => ${ preNewName } ` ) ;
74
+ await rename ( prereleaseVSIX . path , preNewName ) ;
75
+ console . log ( `Renamed artifact: ${ prereleaseVSIX . path } => ${ preNewName } ` ) ;
66
76
await unlink ( "artifacts.zip" ) ;
67
77
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments