当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript azure-pipelines-task-lib.tool函数代码示例

本文整理汇总了TypeScript中azure-pipelines-task-lib.tool函数的典型用法代码示例。如果您正苦于以下问题:TypeScript tool函数的具体用法?TypeScript tool怎么用?TypeScript tool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了tool函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: publish

export function publish(vsixPath: string, manifestPath: string, warningsToIgnore: string) {
    let vsixPublisherExe = getVsixPublisherExe();
    let vsixPublisher = tl.tool(vsixPublisherExe);

    vsixPublisher.arg("publish");
    vsixPublisher.arg(["-payload", vsixPath]);
    vsixPublisher.arg(["-publishManifest", manifestPath]);
    vsixPublisher.arg(["-ignoreWarnings", warningsToIgnore]);

    if (vsixPublisher.execSync({ failOnStdErr: true } as tr.IExecOptions).code !== 0)
    {
        throw new Error("Publish failed.");
    }

    console.info(`Published successfully.`)
}
开发者ID:Microsoft,项目名称:vsts-extension-build-release-tasks,代码行数:16,代码来源:Utils.ts

示例2: login

export function login(publisher: string, token: string) {
    let vsixPublisherExe = getVsixPublisherExe();
    let vsixPublisher = tl.tool(vsixPublisherExe);

    vsixPublisher.arg("login");
    vsixPublisher.arg(["-personalAccessToken", token]);
    vsixPublisher.arg(["-publisherName", publisher]);

    if (vsixPublisher.execSync({ failOnStdErr: true } as tr.IExecOptions).code !== 0)
    {
        throw new Error("Login failed.");
    }

    loggedIn = true;
    console.info(`Login successful.`)
}
开发者ID:Microsoft,项目名称:vsts-extension-build-release-tasks,代码行数:16,代码来源:Utils.ts

示例3: getVsixPublisherExe

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;
 }
开发者ID:Microsoft,项目名称:vsts-extension-build-release-tasks,代码行数:18,代码来源:Utils.ts

示例4: logout

export function logout(publisher: string) {
    if (loggedIn)
    {
        let vsixPublisherExe = getVsixPublisherExe();
        let vsixPublisher = tl.tool(vsixPublisherExe);

        vsixPublisher.arg("logout");
        vsixPublisher.arg(["-publisherName", publisher]);
        vsixPublisher.arg("-ignoreMissingPublisher");

        if (vsixPublisher.execSync({ failOnStdErr: true } as tr.IExecOptions).code !== 0)
        {
            throw new Error("Logout failed.");
        }
        loggedIn = false;
    }
    console.info(`Logout successful.`)
}
开发者ID:Microsoft,项目名称:vsts-extension-build-release-tasks,代码行数:18,代码来源:Utils.ts


注:本文中的azure-pipelines-task-lib.tool函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。