1
1
import "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
+
11
11
12
12
class ManifestData {
13
13
public outputFileName : string ;
@@ -27,13 +27,11 @@ class ManifestData {
27
27
const gen = iteration . toString ( ) . padStart ( 2 , "0" ) ;
28
28
fileName = `${ this . publisher } .${ this . id } -${ this . version } .gen${ gen } .vsix` ;
29
29
}
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
+ }
37
35
} ;
38
36
39
37
updateFileName ( fileName , 0 ) ;
@@ -223,6 +221,7 @@ export class VSIXEditor {
223
221
}
224
222
225
223
private async editVsixManifest ( dirPath : string ) : Promise < ManifestData > {
224
+ const x2jsLib = require ( "x2js" ) ;
226
225
const x2js = new x2jsLib ( ) ;
227
226
228
227
const vsixManifestPath = path . join ( dirPath , "extension.vsixmanifest" ) ;
0 commit comments