@temari/digitm
Version:
git commit 规范的 表情emoji 的提交
37 lines (36 loc) • 1.27 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/*
* @Author: saber
* @Date: 2021-12-27 15:39:25
* @LastEditTime: 2021-12-27 20:08:59
* @LastEditors: saber
* @Description:
*/
const path_1 = __importDefault(require("path"));
const fs_extra_1 = __importDefault(require("fs-extra"));
const commander_1 = require("commander");
const commands_1 = __importDefault(require("./commands"));
const program = new commander_1.Command();
const packageContent = fs_extra_1.default.readFileSync(path_1.default.resolve(__dirname, '../package.json'), 'utf8');
const packageData = JSON.parse(packageContent);
// TODO: 如何集成 gitmoji-cli 呢 后面需要思考一下,针对一些工具的二次开发或者说封装
program
.version(packageData.version)
.name('digitm')
.usage('[options]')
.description('测试')
.option('-c, --commit', '提交commit')
.option('-i, --init', '初始化')
.action(({ commit }) => {
if (commit) {
// 提交
commands_1.default.commit({ mode: 'client' });
}
});
program.parse(process.argv);
// 为啥
exports.default = () => { };