Skip to content

Commit 56a3dcb

Browse files
committed
add colors to logs
Signed-off-by: shmck <[email protected]>
1 parent 60c48ed commit 56a3dcb

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

Diff for: package-lock.json

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"esm": "^3.2.25",
2525
"inquirer": "^7.1.0",
2626
"js-yaml": "^3.14.0",
27+
"kleur": "^3.0.3",
2728
"listr": "^0.14.3",
2829
"lodash": "^4.17.15",
2930
"ncp": "^2.0.0",

Diff for: src/cli.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import "./utils/logs";
12
import build from "./build";
23
import create from "./create";
34

Diff for: src/utils/logs.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { red, yellow, blue } from "kleur";
2+
3+
const _error = console.error;
4+
const _warn = console.warn;
5+
const _info = console.info;
6+
// const log = console.log;
7+
8+
console.error = function () {
9+
// @ts-ignore
10+
_error(red.apply(console, arguments));
11+
};
12+
13+
console.warn = function () {
14+
// @ts-ignore
15+
_warn(yellow.apply(console, arguments));
16+
};
17+
18+
console.info = function () {
19+
// @ts-ignore
20+
_info(blue.apply(console, arguments));
21+
};

0 commit comments

Comments
 (0)