@@ -65,31 +65,29 @@ const repo = repository.split("/")[1];
65
65
await pipeline ( data , createWriteStream ( "artifacts.zip" , data ) ) ;
66
66
const files = await decompress ( "artifacts.zip" , process . cwd ( ) ) ;
67
67
console . log ( `Downloaded artifact(s): ${ files . map ( f => f . path ) . join ( ", " ) } ` ) ;
68
- // const newName = process.env["VSCODE_SWIFT_VSIX"] || "vscode-swift.vsix";
69
- const releaseVSIX = files . find ( f => / s w i f t - v s c o d e - \d + .\d + .\d + ( - d e v ) ? - \d + .v s i x / m. test ( f . path ) ) ;
70
- if ( ! releaseVSIX ) {
71
- console . error ( "Cound not find vscode-swift release VSIX in artifact bundle" ) ;
72
- process . exit ( 1 ) ;
73
- }
74
- // await rename(releaseVSIX.path, newName);
75
- const prereleaseVSIX = files . find ( f =>
76
- / s w i f t - v s c o d e - \d + .\d + .\d { 8 } ( - d e v ) ? - \d + .v s i x / m. test ( f . path )
77
- ) ;
78
- if ( ! prereleaseVSIX ) {
79
- console . error ( "Cound not find vscode-swift pre-release VSIX in artifact bundle" ) ;
80
- process . exit ( 1 ) ;
81
- }
82
- // console.log(`Renamed artifact: ${releaseVSIX.path} => ${newName}`);
83
- // const preNewName =
84
- // process.env["VSCODE_SWIFT_PRERELEASE_VSIX"] || "vscode-swift-prerelease.vsix";
85
- // await rename(prereleaseVSIX.path, preNewName);
86
- // console.log(`Renamed artifact: ${prereleaseVSIX.path} => ${preNewName}`);
87
- if ( process . env [ "VSCODE_SWIFT_VSIX_PRERELEASE" ] === "1" ) {
88
- await appendFile ( envFile , `VSCODE_SWIFT_VSIX=${ prereleaseVSIX . path } \n` ) ;
89
- console . log ( `Running tests against: ${ prereleaseVSIX . path } ` ) ;
68
+ const testPrerelease = process . env [ "VSCODE_SWIFT_VSIX_PRERELEASE" ] === "1" ;
69
+ if ( testPrerelease ) {
70
+ const prereleaseVSIX = files . find ( f =>
71
+ / s w i f t - v s c o d e - \d + .\d + .\d { 8 } ( - d e v ) ? - \d + .v s i x / m. test ( f . path )
72
+ ) ;
73
+ if ( prereleaseVSIX ) {
74
+ await appendFile ( envFile , `VSCODE_SWIFT_VSIX=${ prereleaseVSIX . path } \n` ) ;
75
+ console . log ( `Running tests against: ${ prereleaseVSIX . path } ` ) ;
76
+ } else {
77
+ console . error ( "Cound not find vscode-swift pre-release VSIX in artifact bundle" ) ;
78
+ process . exit ( 1 ) ;
79
+ }
90
80
} else {
91
- await appendFile ( envFile , `VSCODE_SWIFT_VSIX=${ releaseVSIX . path } \n` ) ;
92
- console . log ( `Running tests against: ${ releaseVSIX . path } ` ) ;
81
+ const releaseVSIX = files . find ( f =>
82
+ / s w i f t - v s c o d e - \d + .\d + .\d + ( - d e v ) ? - \d + .v s i x / m. test ( f . path )
83
+ ) ;
84
+ if ( releaseVSIX ) {
85
+ await appendFile ( envFile , `VSCODE_SWIFT_VSIX=${ releaseVSIX . path } \n` ) ;
86
+ console . log ( `Running tests against: ${ releaseVSIX . path } ` ) ;
87
+ } else {
88
+ console . error ( "Cound not find vscode-swift release VSIX in artifact bundle" ) ;
89
+ process . exit ( 1 ) ;
90
+ }
93
91
}
94
92
await unlink ( "artifacts.zip" ) ;
95
93
} ) ( ) ;
0 commit comments