Skip to content

Commit fba6ae6

Browse files
refactor: use the same output for stats command
1 parent cdef7ea commit fba6ae6

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

__tests__/stats/stats-json/snapshot.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@
3636
"total": 3
3737
}
3838
}
39+
Document: museum.yaml stats:
40+
41+
42+
museum.yaml: stats processed in <test>ms
43+

__tests__/stats/stats-markdown/snapshot.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@
1010
| 👷 Operations | 8 |
1111
| 🔖 Tags | 3 |
1212

13+
Document: museum.yaml stats:
14+
15+
16+
museum.yaml: stats processed in <test>ms
17+

packages/cli/src/commands/stats.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ function printStats(
7676
startedAt: number,
7777
format: string
7878
) {
79+
logger.info(`Document: ${colors.magenta(api)} stats:\n\n`);
80+
7981
switch (format) {
8082
case 'stylish':
81-
logger.info(`Document: ${colors.magenta(api)} stats:\n\n`);
8283
printStatsStylish(statsAccumulator);
83-
printExecutionTime('stats', startedAt, api);
8484
break;
8585
case 'json':
8686
printStatsJson(statsAccumulator);
@@ -89,6 +89,8 @@ function printStats(
8989
printStatsMarkdown(statsAccumulator);
9090
break;
9191
}
92+
93+
printExecutionTime('stats', startedAt, api);
9294
}
9395

9496
export type StatsOptions = {

0 commit comments

Comments
 (0)