11import "core-js" ;
2- import temp from "temp" ;
3- import fs from "fs" ;
4- import fse from "fs-extra" ;
5- import path from "path" ;
6- import Q from "q" ;
7- import tl from "azure-pipelines-task-lib/task" ;
8- import tr from "azure-pipelines-task-lib/toolrunner" ;
9- import common from "../../Common/v4/Common" ;
10- import x2jsLib from "x2js" ;
2+ import temp = require ( "temp" ) ;
3+ import fs = require ( "fs" ) ;
4+ import fse = require ( "fs-extra" ) ;
5+ import path = require ( "path" ) ;
6+ import Q = require ( "q" ) ;
7+ import tl = require ( "azure-pipelines-task-lib/task" ) ;
8+ import tr = require ( "azure-pipelines-task-lib/toolrunner" ) ;
9+ import common = require ( "../../Common/v4/Common" ) ;
10+
1111
1212class ManifestData {
1313 public outputFileName : string ;
@@ -27,13 +27,11 @@ class ManifestData {
2727 const gen = iteration . toString ( ) . padStart ( 2 , "0" ) ;
2828 fileName = `${ this . publisher } .${ this . id } -${ this . version } .gen${ gen } .vsix` ;
2929 }
30- fs . exists ( path . join ( outputPath , fileName ) , result => {
31- if ( result ) {
32- updateFileName ( fileName , ++ iteration ) ;
33- } else {
34- tl . debug ( "Generated filename: " + fileName ) ;
35- }
36- } ) ;
30+ if ( fs . existsSync ( path . join ( outputPath , fileName ) ) ) {
31+ updateFileName ( fileName , ++ iteration ) ;
32+ } else {
33+ tl . debug ( "Generated filename: " + fileName ) ;
34+ }
3735 } ;
3836
3937 updateFileName ( fileName , 0 ) ;
@@ -223,6 +221,7 @@ export class VSIXEditor {
223221 }
224222
225223 private async editVsixManifest ( dirPath : string ) : Promise < ManifestData > {
224+ const x2jsLib = require ( "x2js" ) ;
226225 const x2js = new x2jsLib ( ) ;
227226
228227 const vsixManifestPath = path . join ( dirPath , "extension.vsixmanifest" ) ;
0 commit comments