File tree Expand file tree Collapse file tree
extensions/ql-vscode/test/vscode-tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import supportedCliVersions from "../../supported_cli_versions.json";
3636
3737const _1MB = 1024 * 1024 ;
3838const _10MB = _1MB * 10 ;
39+ const _100MB = _10MB * 10 ;
3940
4041// CLI version to test. Use the latest supported version by default.
4142// And be sure to update the env if it is not otherwise set.
@@ -97,7 +98,7 @@ export async function ensureCli(useCli: boolean) {
9798
9899 console . log ( `Unzipping into '${ unzipDir } '` ) ;
99100 mkdirpSync ( unzipDir ) ;
100- await unzipToDirectorySequentially ( downloadedFilePath , unzipDir ) ;
101+ await unzipWithProgress ( downloadedFilePath , unzipDir ) ;
101102 console . log ( "Done." ) ;
102103 } catch ( e ) {
103104 console . error ( "Failed to download CLI." ) ;
@@ -133,6 +134,32 @@ async function downloadWithProgress(url: string, filePath: string) {
133134 } ) ;
134135}
135136
137+ async function unzipWithProgress (
138+ filePath : string ,
139+ unzipDir : string ,
140+ ) : Promise < void > {
141+ let lastMessage = 0 ;
142+
143+ await unzipToDirectorySequentially (
144+ filePath ,
145+ unzipDir ,
146+ ( { bytesExtracted, totalBytes } ) => {
147+ if ( bytesExtracted - lastMessage > _100MB ) {
148+ console . log (
149+ "Extracted" ,
150+ Math . round ( bytesExtracted / _1MB ) ,
151+ "MB /" ,
152+ Math . round ( totalBytes / _1MB ) ,
153+ "MB" ,
154+ ) ;
155+ lastMessage = bytesExtracted ;
156+ }
157+ } ,
158+ ) ;
159+
160+ console . log ( "Finished unzipping into" , unzipDir ) ;
161+ }
162+
136163/**
137164 * Url to download from
138165 */
You can’t perform that action at this time.
0 commit comments