@@ -51,7 +51,7 @@ const getExternalsAsync = async () => {
51
51
downloadFileAsync ( nodeUrl + '/' + nodeVersion + '/win-x64/node.exe' ) ,
52
52
downloadFileAsync ( nodeUrl + '/' + nodeVersion + '/win-x64/node.lib' )
53
53
] ) ;
54
-
54
+
55
55
var nodeDirectory = path . join ( testPath , 'node' ) ;
56
56
mkdir ( '-p' , nodeDirectory ) ;
57
57
cp ( nodeExePath , path . join ( nodeDirectory , 'node.exe' ) ) ;
@@ -118,7 +118,7 @@ var downloadArchiveAsync = async function (url, fileName) {
118
118
if ( test ( '-f' , marker ) ) {
119
119
return targetPath ;
120
120
}
121
-
121
+
122
122
// download the archive
123
123
var archivePath = await downloadFileAsync ( url , scrubbedUrl ) ;
124
124
console . log ( 'Extracting archive: ' + url ) ;
@@ -130,8 +130,16 @@ var downloadArchiveAsync = async function (url, fileName) {
130
130
131
131
// extract
132
132
mkdir ( '-p' , targetPath ) ;
133
- var zip = new admZip ( archivePath ) ;
134
- zip . extractAllTo ( targetPath ) ;
133
+
134
+ if ( targetPath . endsWith ( '.zip' ) ) {
135
+ var zip = new admZip ( archivePath ) ;
136
+ zip . extractAllTo ( targetPath ) ;
137
+ }
138
+ else if ( targetPath . endsWith ( '.tar.gz' ) ) {
139
+ run ( `tar --extract --gzip --file="${ archivePath } " --directory="${ targetPath } "` ) ;
140
+ } else {
141
+ throw new Error ( 'Unsupported archive type: ' + targetPath ) ;
142
+ }
135
143
136
144
// write the completed marker
137
145
fs . writeFileSync ( marker , '' ) ;
0 commit comments