@@ -11,6 +11,7 @@ import { nfcall, ninvoke, SimpleThrottler } from 'vs/base/common/async';
1111import { mkdirp , rimraf } from 'vs/base/node/pfs' ;
1212import { TPromise } from 'vs/base/common/winjs.base' ;
1313import { open as _openZip , Entry , ZipFile } from 'yauzl' ;
14+ import { ILogService } from 'vs/platform/log/common/log' ;
1415
1516export interface IExtractOptions {
1617 overwrite ?: boolean ;
@@ -87,7 +88,7 @@ function extractEntry(stream: Readable, fileName: string, mode: number, targetPa
8788 } ) ) ;
8889}
8990
90- function extractZip ( zipfile : ZipFile , targetPath : string , options : IOptions ) : TPromise < void > {
91+ function extractZip ( zipfile : ZipFile , targetPath : string , options : IOptions , logService : ILogService ) : TPromise < void > {
9192 let isCanceled = false ;
9293 let last = TPromise . wrap < any > ( null ) ;
9394 let extractedEntriesCount = 0 ;
@@ -108,6 +109,8 @@ function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions): TP
108109 return ;
109110 }
110111
112+ logService . debug ( targetPath , 'Extracting' , entry . fileName ) ;
113+
111114 if ( ! options . sourcePathRegex . test ( entry . fileName ) ) {
112115 extractedEntriesCount ++ ;
113116 return ;
@@ -139,7 +142,7 @@ function openZip(zipFile: string): TPromise<ZipFile> {
139142 . then ( null , err => TPromise . wrapError ( toExtractError ( err ) ) ) ;
140143}
141144
142- export function extract ( zipPath : string , targetPath : string , options : IExtractOptions = { } ) : TPromise < void > {
145+ export function extract ( zipPath : string , targetPath : string , options : IExtractOptions = { } , logService : ILogService ) : TPromise < void > {
143146 const sourcePathRegex = new RegExp ( options . sourcePath ? `^${ options . sourcePath } ` : '' ) ;
144147
145148 let promise = openZip ( zipPath ) ;
@@ -148,7 +151,7 @@ export function extract(zipPath: string, targetPath: string, options: IExtractOp
148151 promise = promise . then ( zipfile => rimraf ( targetPath ) . then ( ( ) => zipfile ) ) ;
149152 }
150153
151- return promise . then ( zipfile => extractZip ( zipfile , targetPath , { sourcePathRegex } ) ) ;
154+ return promise . then ( zipfile => extractZip ( zipfile , targetPath , { sourcePathRegex } , logService ) ) ;
152155}
153156
154157function read ( zipPath : string , filePath : string ) : TPromise < Readable > {
0 commit comments