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