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


TypeScript tool.prependPath函数代码示例

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


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

示例1: getAdvinst

async function getAdvinst(version: string, license: string): Promise<void> {

  if (!semvish.valid(version))
    throw Error(taskLib.loc("AI_InvalidVersionFormat", version));

  let cachedToolRoot: string;
  //Verify if this version of advinst was already installed.
  cachedToolRoot = _getLocalTool(semvish.clean(version));

  if (!cachedToolRoot) {
    console.log(taskLib.loc("AI_InstallNewTool"));
    //Extract advinst.msi and cache the content.
    cachedToolRoot = await acquireAdvinst(version);
  }
  else {
    console.log(taskLib.loc("AI_UseCachedTool", cachedToolRoot));
  }

  let msBuildTargetsPath: string = path.join(cachedToolRoot, advinstMSBuildTargetsSubPath);
  //Compute the actual AdvancedInstaller.com folder
  let advinstBinRoot: string = path.join(cachedToolRoot, advinstToolSubPath);
  //Debug traces
  taskLib.debug('cachedToolRoot = ' + cachedToolRoot);
  taskLib.debug('advinstBinRoot = ' + advinstBinRoot);
  taskLib.debug('msBuildTargetsPath = ' + msBuildTargetsPath);

  //Register advinst if a license key was provided
  await registerAdvinst(advinstBinRoot, license);
  //Add the advinst folder to PATH
  toolLib.prependPath(advinstBinRoot);

  //Set the environment variables that will be used by Advanced Installer tasks later on.
  taskLib.setVariable(advinstMSBuildTargetsVar, msBuildTargetsPath);
  taskLib.setVariable(advinstToolRootVar, cachedToolRoot);
}
开发者ID:Caphyon,项目名称:advinst-vsts-task,代码行数:35,代码来源:AdvinstTool.ts

示例2: configureDuffle

async function configureDuffle() {
    const dufflePath = await duffleInstaller.setupDuffle();

    // prepend the tools path. instructs the agent to prepend for future tasks
    if (!process.env['PATH'].toLowerCase().startsWith(path.dirname(dufflePath.toLowerCase()))) {
        toolLib.prependPath(path.dirname(dufflePath));
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:8,代码来源:duffle.ts

示例3: configureCF

async function configureCF() {
    var version = tl.getInput("cfVersion", true);
    var cfPath = await utils.downloadCF(version);

    // prepend the tools path. instructs the agent to prepend for future tasks
    if (!process.env['PATH'].startsWith(path.dirname(cfPath))) {
        toolLib.prependPath(path.dirname(cfPath));
    }
}
开发者ID:Microsoft,项目名称:vsts-cloudfoundry,代码行数:9,代码来源:cfcliinstaller.ts

示例4: configureKubectl

async function configureKubectl() {
    var version = await utils.getKuberctlVersion();
    var kubectlPath = await utils.downloadKubectl(version);

    // prepend the tools path. instructs the agent to prepend for future tasks
    if (!process.env['PATH'].startsWith(path.dirname(kubectlPath))) {
        toolLib.prependPath(path.dirname(kubectlPath));
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:9,代码来源:kubectltoolinstaller.ts

示例5: configureDocker

async function configureDocker() {
    var version = tl.getInput("dockerVersion", true);
    var releaseType = tl.getInput("releaseType", true);

    var dockerPath = await utils.downloadDocker(version, releaseType);

    // prepend the tools path. instructs the agent to prepend for future tasks
    if (!process.env['PATH'].startsWith(path.dirname(dockerPath))) {
        toolLib.prependPath(path.dirname(dockerPath));
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:11,代码来源:dockertoolinstaller.ts

示例6: getTfx

async function getTfx(versionSpec: string, checkLatest: boolean) {
    if (toolLib.isExplicitVersion(versionSpec)) {
        checkLatest = false; // check latest doesn't make sense when explicit version
    }

    let toolPath: string;
    if (!checkLatest) {
        toolPath = toolLib.findLocalTool('tfx', versionSpec);
    }

    if (!toolPath) {
        let version: string;
        if (toolLib.isExplicitVersion(versionSpec)) {
            version = versionSpec;
        }
        else {
            version = queryLatestMatch(versionSpec);
            if (!version) {
                throw new Error(`Unable to find Tfx version '${versionSpec}'`);
            }

            toolPath = toolLib.findLocalTool('tfx', version);
        }

        if (!toolPath) {
            toolPath = await acquireTfx(version);
        }
    }

    if (os.platform() !== "win32")
    {
        toolPath = path.join(toolPath, "/node_modules/.bin/");
    }
    
    taskLib.setVariable("__tfxpath", toolPath, false);
    toolLib.prependPath(toolPath);
}
开发者ID:Microsoft,项目名称:vsts-extension-build-release-tasks,代码行数:37,代码来源:TfxInstaller.ts


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