bsg
Version:
Lint all in one tool for BSG-FE
19 lines (16 loc) • 679 B
JavaScript
module.exports = function () {
const path = require("path");
const bootstrap = require("commitizen/dist/cli/git-cz").bootstrap;
// hack
// 解决 commitizen 强制解析命令第二位开始的参数导致提交出错的问题
// 例如,执行 `bsg commit` 时,commitizen 会把 `commit` 也传入提交参数中
// 导致实际执行结果变为 `git commit -m "[xxx]: xxxxxx" commit`
// 从而报 `pathspec 'commit' did not match any file(s) known to git` 的错误
process.argv.splice(2, 1);
bootstrap({
cliPath: path.resolve("node_modules/commitizen"),
config: {
path: path.join(__dirname, "bsg-conventional-changelog"),
},
});
};