feat(dev-infra): migrate commit-message tool to use new logging system (#37422)

Migrate the commit-message tool in ng-dev to use new logging system rather
than directly calling console.* to create a better experience
for users.

PR Close #37422
This commit is contained in:
Joey Perrott
2020-05-20 14:22:29 -07:00
committed by atscott
parent d6e715e726
commit 59abf4a33f
5 changed files with 28 additions and 17 deletions

View File

@ -9,6 +9,7 @@ import {readFileSync} from 'fs';
import {resolve} from 'path';
import {getRepoBaseDir} from '../utils/config';
import {info} from '../utils/console';
import {validateCommitMessage} from './validate';
@ -16,7 +17,7 @@ import {validateCommitMessage} from './validate';
export function validateFile(filePath: string) {
const commitMessage = readFileSync(resolve(getRepoBaseDir(), filePath), 'utf8');
if (validateCommitMessage(commitMessage)) {
console.info('√ Valid commit message');
info('√ Valid commit message');
return;
}
// If the validation did not return true, exit as a failure.