Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit56a3dcb

Browse files
committed
add colors to logs
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent60c48ed commit56a3dcb

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

‎package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 0 deletions
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",

‎src/cli.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import"./utils/logs";
12
importbuildfrom"./build";
23
importcreatefrom"./create";
34

‎src/utils/logs.ts

Lines changed: 21 additions & 0 deletions
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)

[8]ページ先頭

©2009-2025 Movatter.jp