Skip to content

Commit

Permalink
Use Node APIs to replace __dirname
Browse files Browse the repository at this point in the history
  • Loading branch information
50Wliu authored and jessehouwing committed Jun 27, 2024
1 parent fe29922 commit af5990c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BuildTasks/PublishVSExtension/v5/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import tl from "azure-pipelines-task-lib";
import tr from "azure-pipelines-task-lib/toolrunner.js";
import path from "node:path";
import { fileURLToPath } from "node:url";

let cacheVsixPublisherExe = "";
let loggedIn = false;

export function getVsixPublisherExe(): string {
if (cacheVsixPublisherExe === "") {
const vswhereTool = tl.tool(path.join(__dirname, "tools", "vswhere.exe"));
const vswhereTool = tl.tool(path.join(path.dirname(fileURLToPath(import.meta.url)), "tools", "vswhere.exe"));
vswhereTool.line("-version [15.0,) -latest -requires Microsoft.VisualStudio.Component.VSSDK -find VSSDK\\VisualStudioIntegration\\Tools\\Bin\\VsixPublisher.exe");
const vswhereResult = vswhereTool.execSync({ silent: true } as tr.IExecSyncOptions);
const vsixPublisherExe = vswhereResult.stdout.trim();
Expand Down

0 comments on commit af5990c

Please sign in to comment.