Skip to content

Commit aa1decf

Browse files
authored
fix(@angular/cli): fix colors on git bash (angular#7569)
Fix angular#7239
1 parent 9872d43 commit aa1decf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

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

44

5+
// Force basic color support on terminals with no color support.
6+
// Chalk typings don't have the correct constructor parameters.
7+
const chalkCtx = new (chalk.constructor as any)(chalk.supportsColor ? {} : { level: 1 });
8+
const { bold, green, red, reset, white, yellow } = chalkCtx;
9+
510
function _formatSize(size: number): string {
611
if (size <= 0) {
712
return '0 bytes';

0 commit comments

Comments
 (0)