本文整理匯總了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));