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