diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg deleted file mode 100644 index a6573a5..0000000 --- a/.husky/prepare-commit-msg +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -echo -echo -e "\e[1;36m-----------使用GitMoji-cli编辑提交------------\e[0m" -echo " 遵循 Gitmoji" -echo " https://gitmoji.dev/" -echo -e "\e[1;36m----------------------------------------------\e[0m" - -# exec < /dev/tty -pnpm gitmoji --hook $1 $2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9165f5e..fa0daee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,9 +45,9 @@ pnpm husky ```sh git add . -git commit +pnpm run commit ``` -在提交时,Husky 会自动运行预定义的 Git 钩子脚本,包括对代码规范的检测。 +在提交时,Husky 会自动运行预定义的 Git 钩子脚本,包括对代码规范的检测,同时会使用[gitmoji-cli](https://github.com/carloscuesta/gitmoji)进行交互式提交。 3. 如果提交的代码不符合项目的规范要求,您将会收到相应的错误提示。请根据提示信息进行修改和调整,直到提交的代码符合要求。 diff --git a/package.json b/package.json index a426269..ca28c25 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "scripts": { "contributors:add": "all-contributors add", "contributors:generate": "all-contributors generate", - "lint": "lint-staged --allow-empty" + "lint": "lint-staged --allow-empty", + "commit": "gitmoji --commit" }, "repository": { "type": "git",