From 7013119a76cbcb5a64e84f7779f2fc8161bfbdde Mon Sep 17 00:00:00 2001 From: Jesse Houwing Date: Wed, 8 Jan 2025 17:23:52 +0100 Subject: [PATCH] fixing vsixpublisher in v4 --- BuildTasks/PublishExtension/v4/vsixeditor.ts | 31 ++++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/BuildTasks/PublishExtension/v4/vsixeditor.ts b/BuildTasks/PublishExtension/v4/vsixeditor.ts index 90c24781..be086454 100644 --- a/BuildTasks/PublishExtension/v4/vsixeditor.ts +++ b/BuildTasks/PublishExtension/v4/vsixeditor.ts @@ -1,13 +1,13 @@ import "core-js"; -import temp from "temp"; -import fs from "fs"; -import fse from "fs-extra"; -import path from "path"; -import Q from "q"; -import tl from "azure-pipelines-task-lib/task"; -import tr from "azure-pipelines-task-lib/toolrunner"; -import common from "../../Common/v4/Common"; -import x2jsLib from "x2js"; +import temp = require("temp"); +import fs = require("fs"); +import fse = require("fs-extra"); +import path = require("path"); +import Q = require("q"); +import tl = require("azure-pipelines-task-lib/task"); +import tr = require("azure-pipelines-task-lib/toolrunner"); +import common = require("../../Common/v4/Common"); + class ManifestData { public outputFileName: string; @@ -27,13 +27,11 @@ class ManifestData { const gen = iteration.toString().padStart(2, "0"); fileName = `${this.publisher}.${this.id}-${this.version}.gen${gen}.vsix`; } - fs.exists(path.join(outputPath, fileName), result => { - if (result) { - updateFileName(fileName, ++iteration); - } else { - tl.debug("Generated filename: " + fileName); - } - }); + if (fs.existsSync(path.join(outputPath, fileName))) { + updateFileName(fileName, ++iteration); + } else { + tl.debug("Generated filename: " + fileName); + } }; updateFileName(fileName, 0); @@ -223,6 +221,7 @@ export class VSIXEditor { } private async editVsixManifest(dirPath: string): Promise { + const x2jsLib = require("x2js"); const x2js = new x2jsLib(); const vsixManifestPath = path.join(dirPath, "extension.vsixmanifest");