Skip to content

Commit f286654

Browse files
committed
🔧 chore(feature): 更新日志
1 parent 3ad8a93 commit f286654

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/command/git-commit.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import { performance } from "node:perf_hooks";
2+
13
import type { CAC } from "cac";
24
import enquirer from "enquirer";
35

46
import { ACTIVATION, gitCommitScopes, gitCommitTypes } from "@/config";
5-
import { execCommand, loadConfigModule, loggerInfo } from "@/helper";
7+
import { execCommand, loadConfigModule, loggerInfo, printInfo } from "@/helper";
68
import { GitCommitOptions } from "@/types";
79

810
const mergeConfig = async () => {
@@ -103,13 +105,17 @@ export default function gitCommitInstaller(cli: CAC) {
103105
.option("-s, --scope <scope>", "填写修改范围")
104106
.option("-d, --description <description>", "填写修改描述")
105107
.action(async (options) => {
108+
const start = performance.now();
109+
106110
const { type, scope, description } = options;
107111
if (!type || !scope || !description) {
108112
const result = await generateEnquirer();
109113
await gitCommit(result.type, result.scope, result.description);
110114
} else {
111115
await gitCommit(type, scope, description);
112116
}
117+
const getTime = () => `${(performance.now() - start).toFixed(2)}ms`;
118+
printInfo(`😁 commit 命令执行结束, 共用时: ${getTime()}`);
113119
});
114120
},
115121
};

0 commit comments

Comments
 (0)