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


TypeScript vsotask.error函数代码示例

本文整理汇总了TypeScript中vso-task-lib/vsotask.error函数的典型用法代码示例。如果您正苦于以下问题:TypeScript error函数的具体用法?TypeScript error怎么用?TypeScript error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了error函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: conflicts

 }
 
 // now that all the branches are local, test the merges
 errors = 0;
 for (var i = 0; i < branchesToMerge.length; i++) {
     var branch = branchesToMerge[i].trim();
     
     if (ut.merge(branch, false)) {
         console.info(`No merge conflicts detected when merging ${branch}`);
         
         if (testMergeAll) {
             // if we're testing all the merges, then we need to commit before
             // merging the next branch
             if (!ut.commit("Testing merge")) {
                 errors++;
                 tl.error("Commit failed");
                 break;
             }
         } else {
             ut.abortMerge();
         }
     } else {
         errors++;
         tl.error(`Merge ${branch} operation has conflicts (or failed)`);
     }
 }
 
 // clean up
 ut.checkoutCommit(commitId);
 
 // fail the task if there were errors
开发者ID:ericmaino,项目名称:vsts-gitmerge,代码行数:31,代码来源:merge.ts

示例2: RegExp

	console.info(`Using prefix [${replacePrefix}] and version [${versionNum}] in folder [${sourcePath}]`);
	
    var filesToReplace = tl.glob(`${sourcePath}\\${filePattern}`);
	
	if (filesToReplace === undefined || filesToReplace.length === 0) {
		tl.warning("No files found");
	} else {
		for (var i = 0; i < filesToReplace.length; i++) {
            var file = filesToReplace[i];
            console.info(`Changing version in ${file}`);
            
            var contents = fs.readFileSync(file, 'utf8').toString();
            var checkMatches = new RegExp(replaceRegex).exec(contents);
            if (!checkMatches || checkMatches.length === 0) {
                if (failIfNoMatchFound) {
                    tl.error(`No matches for regex [${replaceRegex}] found in file ${file}`);
                    process.exit(1);
                } else {
                    tl.warning(`No matches for regex [${replaceRegex}] found in file ${file}`);
                }
            } else {
                console.info(`${checkMatches.length} matches for regex [${replaceRegex}] found in file ${file}`);
                
                // make the file writable
                sh.chmod(666, file);
                // replace all occurrences by adding g to the pattern
                sh.sed("-i", new RegExp(replaceRegex, "g"), replacePrefix + versionNum, file);
            }
        }
		console.info(`Processed ${filesToReplace.length} files`);
	}
开发者ID:dixu99,项目名称:cols-agent-tasks,代码行数:31,代码来源:versionAssemblies.ts

示例3: conflicts

 
 // now that all the branches are local, test the merges
 errors = 0;
 for (var i = 0; i < branchesToMerge.length; i++) {
     var branch = branchesToMerge[i].trim();
     
     var mergeRes = ut.merge(branch, false);
     if (mergeRes.code === 0) {
         console.info(`No merge conflicts detected when merging ${branch}`);
         
         if (testMergeAll) {
             // if we're testing all the merges, then we need to commit before
             // merging the next branch
             if (!ut.commit("Testing merge")) {
                 errors++;
                 tl.error("Commit failed");
                 break;
             }
         } else {
             if (mergeRes.stdout.indexOf('Already up-to-date') < 0) {
                 ut.abortMerge();
             }
         }
     } else {
         errors++;
         tl.error(`Merge ${branch} operation has conflicts (or failed)`);
     }
 }
 
 // clean up
 ut.checkoutCommit(sourceCommitId);
开发者ID:colindembovsky,项目名称:vsts-gitmerge,代码行数:30,代码来源:merge.ts


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