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