export function getVsixPublisherExe()

in BuildTasks/PublishVSExtension/Utils.ts [8:25]


export function getVsixPublisherExe(): string {
    if (cacheVsixPublisherExe === "") {
        const vswhereTool = tl.tool(path.join(__dirname, "tools", "vswhere.exe"));
        vswhereTool.line("-version [15.0,17.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();
        if (vswhereResult.code === 0 && vsixPublisherExe && tl.exist(vsixPublisherExe))
        {
            tl.debug('VsixPublisher.exe installed path: ' + vsixPublisherExe);
            cacheVsixPublisherExe = vsixPublisherExe;
        }
        else
        {
            throw new Error("Could not locate vsixpublisher.exe. Ensure the Visual Studio SDK is installed on the agent.");
        }
    }
    return cacheVsixPublisherExe;
 }