Skip to content

Commit 6182074

Browse files
committed
fix(@angular/cli): fix colors on git bash
Fix angular#7239
1 parent b33c696 commit 6182074

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/@angular/cli/utilities/stats.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
import { bold, green, red, reset, white, yellow } from 'chalk';
1+
import * as chalk from 'chalk';
22
import { stripIndents } from 'common-tags';
33

4+
// Force basic color support on terminals with no color support.
5+
// Chalk typings don't have the correct constructor parameters.
6+
const chalkCtx = new (chalk.constructor as any)(chalk.supportsColor ? {} : { level: 1 });
7+
const { bold, green, red, reset, white, yellow } = chalkCtx;
48

59
function _formatSize(size: number): string {
610
if (size <= 0) {

0 commit comments

Comments
 (0)