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