@@ -146,10 +146,25 @@ export class VSIXEditor {
146146 }
147147 else {
148148 const zip = new tr . ToolRunner ( tl . which ( "unzip" , true ) ) ;
149- zip . arg ( "-o" ) ; // overwrite all
150- zip . arg ( "-d" ) ; // redirect output to
151- zip . arg ( tmpPath ) ; // output directory
152- zip . arg ( vsix ) ; // file to extract
149+
150+ if ( tl . getVariable ( "PREVIEW_FAST_UPDATE" ) === "true" )
151+ {
152+ zip . arg ( "-o" ) ; // overwrite all
153+ zip . arg ( "-C" ) ; // match case insensitive
154+ zip . arg ( "-d" ) ; // redirect output to
155+ zip . arg ( tmpPath ) ; // output directory
156+ zip . arg ( vsix ) ; // file to extract
157+ zip . arg ( "'*/task.json'" ) ;
158+ zip . arg ( "'*/task.loc.json'" ) ;
159+ zip . arg ( "extension.vsixmanifest" ) ;
160+ zip . arg ( "extension.vsomanifest" ) ;
161+ }
162+ else {
163+ zip . arg ( "-o" ) ; // overwrite all
164+ zip . arg ( "-d" ) ; // redirect output to
165+ zip . arg ( tmpPath ) ; // output directory
166+ zip . arg ( vsix ) ; // file to extract
167+ }
153168 zip . execSync ( ) ;
154169 }
155170 tl . cd ( cwd ) ;
@@ -189,11 +204,24 @@ export class VSIXEditor {
189204 }
190205 else {
191206 const zip = new tr . ToolRunner ( tl . which ( "zip" , true ) ) ;
192- tl . cd ( tmpPath ) ;
193- zip . arg ( path . join ( cwd , targetVsix ) ) ; // redirect output to file
194- zip . arg ( "." ) ;
195- zip . arg ( "-r" ) ; // recursive
196- zip . arg ( "-9" ) ; // max compression level
207+
208+ if ( tl . getVariable ( "PREVIEW_FAST_UPDATE" ) === "true" )
209+ {
210+ tl . cd ( tmpPath ) ;
211+ zip . arg ( path . join ( cwd , targetVsix ) ) ; // redirect output to file
212+ zip . arg ( "." ) ;
213+ zip . arg ( "-r" ) ; // recursive
214+ zip . arg ( "-9" ) ; // max compression level
215+ }
216+ else {
217+ if ( originalVsix !== targetVsix ) { tl . cp ( originalVsix , targetVsix , "-f" ) ; }
218+ tl . cd ( tmpPath ) ;
219+ zip . arg ( path . join ( cwd , targetVsix ) ) ; // redirect output to file
220+ zip . arg ( "." ) ;
221+ zip . arg ( "-r" ) ; // recursive
222+ zip . arg ( "-9" ) ; // max compression level
223+ zip . arg ( "-f" ) ; // update changed files only
224+ }
197225 zip . execSync ( ) ;
198226 }
199227 tl . cd ( cwd ) ;
0 commit comments