fix(@angular/cli): fix colors on git bash (#7569)

Fix #7239
This commit is contained in:
Filipe Silva 2017-09-04 09:50:03 +01:00 committed by GitHub
parent 9872d43887
commit aa1decff10

View File

@ -1,7 +1,12 @@
import { bold, green, red, reset, white, yellow } from 'chalk'; import * as chalk from 'chalk';
import { stripIndents } from 'common-tags'; import { stripIndents } from 'common-tags';
// Force basic color support on terminals with no color support.
// Chalk typings don't have the correct constructor parameters.
const chalkCtx = new (chalk.constructor as any)(chalk.supportsColor ? {} : { level: 1 });
const { bold, green, red, reset, white, yellow } = chalkCtx;
function _formatSize(size: number): string { function _formatSize(size: number): string {
if (size <= 0) { if (size <= 0) {
return '0 bytes'; return '0 bytes';