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


TypeScript task.cd函数代码示例

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


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

示例1: executeTypings

function executeTypings(tool?: ToolRunner) {
    tl.cd(cwd);

    tool = tool || tl.createToolRunner(typings);
    tool.arg(tl.getInput("command", false));
    tool.arg(tl.getInput("arguments", false));

    return tool.exec()
        .then((code) => {
            tl.setResult(tl.TaskResult.Succeeded, tl.loc("typingsReturnCode", code));
        })
        .catch((err) => {
            tl.debug("taskRunner fail");
            tl.setResult(tl.TaskResult.Failed, tl.loc("typingsFailed", err.message));
        });
}
开发者ID:touchifyapp,项目名称:vsts-typings,代码行数:16,代码来源:typingstask.ts

示例2: executePythonTool

(async () => {
    //PyPI upload
    try{
        tl.cd(workingDirectory);
        await executePythonTool("-m pip install twine --user");
        await executePythonTool("setup.py sdist");
        if(wheel){
            await executePythonTool("-m pip install wheel --user");
            await executePythonTool("setup.py bdist_wheel --universal");
        }
        await executePythonTool("-m twine upload dist/*");
    }
    catch(err){
        tl.setResult(tl.TaskResult.Failed, error);
    }
    finally{
        //Delete .pypirc file
        tl.rmRF(pypircFilePath);
        tl.setResult(tl.TaskResult.Succeeded);
    };
})();
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:21,代码来源:publisher.ts

示例3: require

"use strict";

import path = require('path');
import * as tl from "vsts-task-lib/task";
import ContainerConnection from "docker-common/containerconnection";
import AuthenticationTokenProvider  from "docker-common/registryauthenticationprovider/authenticationtokenprovider"
import ACRAuthenticationTokenProvider from "docker-common/registryauthenticationprovider/acrauthenticationtokenprovider"
import GenericAuthenticationTokenProvider from "docker-common/registryauthenticationprovider/genericauthenticationtokenprovider"
import Q = require('q');

tl.setResourcePath(path.join(__dirname, 'task.json'));

// Change to any specified working directory
tl.cd(tl.getInput("cwd"));

// get the registry server authentication provider 
var registryType = tl.getInput("containerregistrytype", true);
var authenticationProvider : AuthenticationTokenProvider;

if(registryType ==  "Azure Container Registry"){
    authenticationProvider = new ACRAuthenticationTokenProvider(tl.getInput("azureSubscriptionEndpoint"), tl.getInput("azureContainerRegistry"));
} 
else {
    authenticationProvider = new GenericAuthenticationTokenProvider(tl.getInput("dockerRegistryEndpoint"));
}

var registryAuthenticationToken = authenticationProvider.getAuthenticationToken();

// Connect to any specified container host and/or registry 
var connection = new ContainerConnection();
connection.open(tl.getInput("dockerHostEndpoint"), registryAuthenticationToken);
开发者ID:grawcho,项目名称:vso-agent-tasks,代码行数:31,代码来源:container.ts

示例4: findBower

import * as path from "path";
import * as tl from "vsts-task-lib/task";
import { ToolRunner } from "vsts-task-lib/toolrunner";

tl.setResourcePath(path.join(__dirname, "task.json"));

const
    command = tl.getInput("command", true),
    bowerFile = tl.getPathInput("bowerjson", true, true),
    cwd = path.dirname(bowerFile) || ".";

tl.cd(cwd);

let bower = findGlobalBower();

if (bower) {
    executeBower();
}
else {
    findBower();
}

function findBower(): Promise<void> {
    tl.debug("not found global installed bower, try to find bower locally.");

    let bowerRuntime = tl.getInput("bowerRuntime", true);
    bowerRuntime = path.resolve(cwd, bowerRuntime);

    tl.debug("check path : " + bowerRuntime);
    if (tl.exist(bowerRuntime)) {
        const tool = tl.tool(tl.which("node", true));
开发者ID:touchifyapp,项目名称:vsts-bower,代码行数:31,代码来源:bowertask.ts


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