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


TypeScript task.debug函数代码示例

本文整理汇总了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);
    }
}
开发者ID:bleissem,项目名称:vsts-tasks,代码行数:10,代码来源:util.ts

示例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;
}
开发者ID:ReneSchumacher,项目名称:VSTS-Tasks,代码行数:10,代码来源:nlbtask.ts

示例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));
                }
            });
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:19,代码来源:downloadutility.ts

示例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;
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:19,代码来源:fileutils.ts

示例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) => {
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:10,代码来源:ArtifactDetailsDownloader.ts

示例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;
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:10,代码来源:versioninstaller.ts

示例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);
        }
    }
}
开发者ID:shubham90,项目名称:vsts-tasks,代码行数:10,代码来源:util.ts

示例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);
}
开发者ID:bleissem,项目名称:vsts-tasks,代码行数:42,代码来源:versionfinder.ts

示例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");
            }
        }
    }
}
开发者ID:shubham90,项目名称:vsts-tasks,代码行数:42,代码来源:packerBuild.ts


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