當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。