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


TypeScript task.command函数代码示例

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


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

示例1: _extractAdvinst

async function _extractAdvinst(sourceMsi: string): Promise<string> {
  console.log(taskLib.loc("AI_ExtractTool"));

  // Ensure the c:\windows\installer folder exists. MSIEXEC will fail on some clients (E.g. Hosted VS2017)
  // due to the lack of this folder.

  let windowsInstallerFolder = path.join(taskLib.getVariable('windir'), 'Installer');
  if (!taskLib.exist(windowsInstallerFolder)) {
    taskLib.debug(taskLib.loc("AI_CreateInstallerFolder"))
    taskLib.mkdirP(windowsInstallerFolder);
  }

  let advinstWorkFolder = path.join(_getAgentTemp(), 'AdvancedInstaller');
  let msiExtractionPath: string = path.join(advinstWorkFolder, 'resources');
  // Create the work folder, otherwise msiexec will fail because of the log path.
  if (!taskLib.exist(advinstWorkFolder))
    taskLib.mkdirP(advinstWorkFolder);
  let msiLogPath: string = path.join(advinstWorkFolder, 'advinst_install.log');

  let msiexecArguments: string[] = ['/a', sourceMsi, 'TARGETDIR=' + msiExtractionPath, '/qn', '/l*v', msiLogPath];

  let exitCode = taskLib.execSync('msiexec.exe', msiexecArguments).code;
  if (exitCode != 0) {
    taskLib.command('task.uploadfile', {}, msiLogPath);
    return null;
  }
  return msiExtractionPath;
}
开发者ID:Caphyon,项目名称:advinst-vsts-task,代码行数:28,代码来源:AdvinstTool.ts

示例2: applyManipulations

            break;
    }

    if (pointInTime === "afterManipulation") {
        tl.debug("Applying selected manipulations.");
        value = applyManipulations(value);
    }
} else {
    tl.debug("Applying selected manipulations.");
    value = applyManipulations(value);
}

const variable = tl.getInput("variableName", true);

if (variable.search(/^Build[._]BuildNumber$/i) >= 0) {
    tl.command("build.updatebuildnumber", null, value);
    console.log(`Set buildnumber to: ${value}`);
    tl.setResult(tl.TaskResult.Succeeded, `Set buildnumber to: ${value}`);
} else {
    tl.setVariable(variable, value, isSecret);
    console.log(`Set ${variable} to: ${value}`);
    tl.setResult(tl.TaskResult.Succeeded, `Set ${variable} to: ${value}`);
}

function applyManipulations(value: string): string {
    if (tl.getBoolInput("searchReplace", false)) {
        tl.debug("Applying selected Search & Replace.");
        value = searchAndReplace(value);
    }

    if (tl.getBoolInput("trim", false)) {
开发者ID:jessehouwing,项目名称:vsts-variable-tasks,代码行数:31,代码来源:vsts-variable-transform.ts

示例3: publishTelemetry

export function publishTelemetry(area: string, feature: string, properties: { [key: string]: any }): void {
    const data = JSON.stringify(properties);
    tl.debug('telemetry area: ' + area + ' feature: ' + feature + ' data: ' + data);
    tl.command('telemetry.publish', { 'area': area, 'feature': feature }, data);
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:5,代码来源:cieventlogger.ts


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