本文整理汇总了TypeScript中vsts-task-lib/task.debug函数的典型用法代码示例。如果您正苦于以下问题:TypeScript debug函数的具体用法?TypeScript debug怎么用?TypeScript debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: saveFile
export function saveFile(file: string): void {
if (file && tl.exist(file)) {
let tempPath = getTempPath();
let baseName = path.basename(file);
let destination = path.join(tempPath, baseName);
tl.debug(tl.loc('SavingFile', file));
copyFile(file, destination);
}
}
示例2: getNetworkInterface
async function getNetworkInterface(SPN, endpointUrl: string, resourceGroupName: string) {
var nics = await nlbUtility.getNetworkInterfacesInRG(SPN, endpointUrl, resourceGroupName);
tl.debug(`Getting Primary Network Interface for the virtual machine : ${process.env.COMPUTERNAME}`);
var nicVm = utility.getPrimaryNetworkInterface(nics);
if (!nicVm) {
throw tl.loc("CouldNotFetchNicDetails", process.env.COMPUTERNAME);
}
return nicVm;
}
示例3: resolve
res.on("end", () => {
file.end(null, null, file.close);
if(printData) {
tl.debug(body);
}
if (isDownloadSucceeded(res)) {
tl.debug("File download completed");
resolve();
}
else if (isRedirect(res) && handleRedirect) {
var redirectOptions = getRedirectOptions(options, res.headers.location);
resolve(this.download(redirectOptions, downloadPath, printData, false));
}
else {
tl.debug("File download failed");
reject(new Error('Failed to download file status code: ' + res.statusCode));
}
});
示例4: findDockerFile
export function findDockerFile(dockerfilepath : string) : string {
if (dockerfilepath.indexOf('*') >= 0 || dockerfilepath.indexOf('?') >= 0) {
tl.debug(tl.loc('ContainerPatternFound'));
let workingDirectory = tl.getVariable('System.DefaultWorkingDirectory');
let allFiles = tl.find(workingDirectory);
let matchingResultsFiles = tl.match(allFiles, dockerfilepath, workingDirectory, { matchBase: true });
if (!matchingResultsFiles || matchingResultsFiles.length == 0) {
throw new Error(tl.loc('ContainerDockerFileNotFound', dockerfilepath));
}
return matchingResultsFiles[0];
}
else
{
tl.debug(tl.loc('ContainerPatternNotFound'));
return dockerfilepath;
}
}
示例5:
downloadHelper.DownloadJsonContent(buildUrl, source, null).then(() => {
console.log(tl.loc("FoundBuildIndex", startIndex, endIndex));
if (startIndex === -1 || endIndex === -1) {
tl.debug(`cannot find valid startIndex ${startIndex} or endIndex ${endIndex}`);
defer.reject(tl.loc("CannotFindBuilds"));
}
else {
defer.resolve({startIndex: startIndex, endIndex: endIndex});
}
}, (error) => {
示例6: catch
isLatest = isLatest && filePaths.findIndex(filePath => {
try {
var versionCompleteFileName = this.getVersionCompleteFileName(path.basename(filePath));
tl.debug(tl.loc("ComparingInstalledFileVersions", version, versionCompleteFileName));
return utils.versionCompareFunction(versionCompleteFileName, version) > 0
}
catch (ex) {
// no op, file name might not be in version format
}
}) < 0;
示例7: restoreFileWithName
export function restoreFileWithName(file: string, name: string, filePath: string): void {
if (file) {
const source = path.join(filePath, name + '.npmrc');
if (tl.exist(source)) {
tl.debug(tl.loc('RestoringFile', file));
copyFile(source, file);
tl.rmRF(source);
}
}
}
示例8: locateTestWindow
function locateTestWindow(testConfig: models.TestConfigurations): string {
if (testConfig.vsTestLocationMethod === utils.Constants.vsTestLocationString) {
if (utils.Helper.pathExistsAsFile(testConfig.vsTestLocation)) {
return path.join(testConfig.vsTestLocation, '..');
}
if (utils.Helper.pathExistsAsDirectory(testConfig.vsTestLocation) &&
utils.Helper.pathExistsAsFile(path.join(testConfig.vsTestLocation, 'vstest.console.exe'))) {
return testConfig.vsTestLocation;
}
throw (new Error(tl.loc('VstestLocationDoesNotExist', testConfig.vsTestLocation)));
}
if (testConfig.vsTestVersion.toLowerCase() === 'latest') {
// latest
tl.debug('Searching for latest Visual Studio');
const vstestconsole15Path = getVSTestConsole15Path();
if (vstestconsole15Path) {
testConfig.vsTestVersion = "15.0";
return vstestconsole15Path;
}
// fallback
tl.debug('Unable to find an instance of Visual Studio 2017..');
tl.debug('Searching for Visual Studio 2015..');
testConfig.vsTestVersion = "14.0";
return getVSTestLocation(14);
}
const vsVersion: number = parseFloat(testConfig.vsTestVersion);
if (vsVersion === 15.0) {
const vstestconsole15Path = getVSTestConsole15Path();
if (vstestconsole15Path) {
return vstestconsole15Path;
}
throw (new Error(tl.loc('VstestNotFound', utils.Helper.getVSVersion(vsVersion))));
}
tl.debug('Searching for Visual Studio ' + vsVersion.toString());
return getVSTestLocation(vsVersion);
}
示例9: setOutputVariables
function setOutputVariables(packerHost: packerHost, outputs: Map<string, string>): void {
var taskParameters = packerHost.getTaskParameters();
var imageUri;
var managedImageName;
if (!utils.IsNullOrEmpty(taskParameters.imageUri)) {
if (taskParameters.templateType === constants.TemplateTypeBuiltin) {
if (!taskParameters.isManagedImage) {
imageUri = outputs.get(constants.PackerLogTokenImageUri);
if (!utils.IsNullOrEmpty(imageUri)) {
tl.debug("Setting image URI variable to: " + imageUri);
tl.setVariable(taskParameters.imageUri, imageUri);
} else {
throw tl.loc("ImageURIOutputVariableNotFound");
}
} else {
imageUri = outputs.get(constants.PackerLogTokenManagedImageName);
if (!utils.IsNullOrEmpty(imageUri)) {
tl.debug("Setting image URI variable which contains the managed image name to: " + imageUri);
tl.setVariable(taskParameters.imageUri, imageUri);
} else {
throw tl.loc("ManagedImageNameOutputVariableNotFound");
}
}
} else {
imageUri = outputs.get(constants.PackerLogTokenImageUri);
managedImageName = outputs.get(constants.PackerLogTokenManagedImageName);
if (!utils.IsNullOrEmpty(managedImageName)) {
tl.debug("Setting image URI variable which contains the managed image name to: " + managedImageName);
tl.setVariable(taskParameters.imageUri, managedImageName);
}
else if (!utils.IsNullOrEmpty(imageUri)) {
tl.debug("Setting image URI variable to: " + imageUri);
tl.setVariable(taskParameters.imageUri, imageUri);
}
else {
throw tl.loc("CustumTemplateOutputVariableNotFound");
}
}
}
}