本文整理汇总了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);
}
示例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));
}
}
示例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));
}
}
示例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));
}
}
示例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));
}
}
示例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);
}