Skip to content

Commit f5755f0

Browse files
committed
🔧chore(app): 调整参数打印
1 parent f056595 commit f5755f0

File tree

9 files changed

+11
-20
lines changed

9 files changed

+11
-20
lines changed

src/command/clear.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { ACTIVATION, clearGlob } from "@/shared/config";
55

66
export const clear = async (paths: string[]) => {
77
if (ACTIVATION) {
8-
loggerInfo("clear 参数信息: \n");
9-
console.table(paths);
8+
loggerInfo(`clear 参数信息: \n ${JSON.stringify(paths)}`);
109
}
1110
await execCommand("npx", ["rimraf", "--glob", ...paths], {
1211
stdio: "inherit",

src/command/create-project.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ interface PromptResult {
1212

1313
export const createProject = async (sources: ProjectSource[]) => {
1414
if (ACTIVATION) {
15-
loggerInfo("createProject 参数信息: \n");
16-
console.table(sources);
15+
loggerInfo(`createProject 参数信息: \n ${JSON.stringify(sources)}`);
1716
}
1817

1918
const sourceChoices = sources.map(({ name, display, description }) => {

src/command/eslint-fix.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import { ACTIVATION, eslintGlob } from "@/shared/config";
1111

1212
export const eslintFix = async (paths: string[]) => {
1313
if (ACTIVATION) {
14-
loggerInfo("eslintFix 参数信息: \n");
15-
console.table(paths);
14+
loggerInfo(`eslintFix 参数信息: \n ${paths}`);
1615
}
1716

1817
try {

src/command/git-commit.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ export const gitCommit = async (
2121
options: GitCommitOptions,
2222
) => {
2323
if (ACTIVATION) {
24-
loggerInfo("gitCommit 参数信息: \n");
25-
console.table(types);
26-
console.table(scopes);
27-
console.table(options);
24+
loggerInfo(
25+
`gitCommit 参数信息: \ntypes ${types} \nscopes${scopes} \noptions${options}`,
26+
);
2827
}
2928
const { emoji: emojiStatus } = options;
3029
const typesChoices = types.map(({ emoji, code, description }) => {

src/command/git-user.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ async function printCurrentGitUser() {
1818

1919
export const gitUser = async (options: GitUserOptions) => {
2020
if (ACTIVATION) {
21-
loggerInfo("gitUser 参数信息: \n");
22-
console.table(options);
21+
loggerInfo(`gitUser 参数信息: \n ${JSON.stringify(options)}`);
2322
}
2423

2524
const { name, email, ruleName, ruleEmail } = options;

src/command/lighthouse.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ async function getReportfile(url: string) {
1515

1616
export const lighthouse = async (url: string) => {
1717
if (ACTIVATION) {
18-
loggerInfo("lighthouse 参数信息: \n");
19-
console.table(url);
18+
loggerInfo(`lighthouse 参数信息: \n ${url}`);
2019
}
2120

2221
const histories = await getReportfile(url);

src/command/prettier-format.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { ACTIVATION, formatGlob } from "@/shared/config";
55

66
export const prettierFormat = async (paths: string[]) => {
77
if (ACTIVATION) {
8-
loggerInfo("prettierFormat 参数信息: \n");
9-
console.table(paths);
8+
loggerInfo(`prettierFormat 参数信息: \n${JSON.stringify(paths)}`);
109
}
1110

1211
await execCommand("npx", ["prettier", "--write", ...paths], {

src/command/quantity.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { ACTIVATION } from "@/shared/config";
66

77
export const quantity = async (dir: string) => {
88
if (ACTIVATION) {
9-
loggerInfo("clear 参数信息: \n");
10-
console.table({ dir });
9+
loggerInfo(`clear 参数信息: \n${dir}`);
1110
}
1211
const root = path.join(process.cwd(), dir);
1312
await execCommand("npx", ["cloc", root], {

src/command/template.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ interface PromptResult {
3232

3333
export const template = async (options: TemplateOptions) => {
3434
if (ACTIVATION) {
35-
loggerInfo("template 参数信息: \n");
36-
console.table(options);
35+
loggerInfo(`template 参数信息: \n${JSON.stringify(options)}`);
3736
}
3837

3938
const { projectName } = await enquirer.prompt<PromptResult>({

0 commit comments

Comments
 (0)